Tkinter - getting canvas window size

Fredrik Lundh fredrik at pythonware.com
Tue Sep 18 19:41:51 CEST 2001


Rick Pasotto wrote:
> Why do the print statements in the following program show zero?

"cget" returns the option value as specified (or in this case, the
default value), not the actual size.

> How can I figure out the size of the frame?

Use winfo_width/height (current size) or winfo_reqwidth/reqheight
(requested size).  the latter is usually what you want.

more info here:

http://www.pythonware.com/library/tkinter/introduction/basic-widget-methods.htm
=> Window Related Information

</F>

<!-- (the eff-bot guide to) the python standard library:
http://www.pythonware.com/people/fredrik/librarybook.htm
-->





More information about the Python-list mailing list