Tkinter Toplevel geometry

Chris ceball at
Sun Mar 25 08:13:01 CEST 2007


If a user resizes a Toplevel window, or I set a Toplevel's geometry
using the geometry() method*, is there any way to have the geometry
reset to that required for all the widgets?

I think I found what I'm looking for in tk itself:
13.3. How can I clear the geometry settings for a toplevel?
If you want to have Tk resize your toplevel to what the toplevel
requires (ie: the user might have resized it, or a widget was
removed), use [wm geometry $toplevel].

* for instance, if I want to turn of Tkinter's automatic adjustment of
the window to fit all the widgets by doing something like
self.geometry(self.geometry()), is there any way to undo that?


More information about the Python-list mailing list