title: How to get the dimensions of a rectangle in tkinter - Python
body: <p>I was experimenting with tkinter, and have come across a situation in which I need to find the dimensions (height and width) of a rectangle that I have drawn on a canvas. However, when I get the dimensions of it normally, with the</p>
  
  <p>button_rectangle.winfo_width() </p>
  
  <p>I get an error saying 'int' object has no attribute 'winfo_height'.
  I don't now what I am doing wrong, as it gives the same error when I try to do 'update' or 'update_idletasks'.
  The size of the rectangle is going to be dynamically changed throughout the program, so I can't manually calculate the dimensions.
  I don't know what I am doing wrong, any help would be much appreciated.
  Here is where I am first defining the rectangle:</p>
  
  <pre><code>button_rectangle = bg_canvas.create_rectangle(0,264,9999,300,outline="white",fill="white")
  </code></pre>