I have a tkinter window which I am able to make fullscreen, using geometry(width+height)
and overrideredirect(True)
, but now when I return the window back to a normal size and execute the command overrideredirect(False)
, I cannot seem to get the window to automatically follow the size of the widgets inside it, as it would do had I not changed the size. Do you know any way which I could return the window to automatically following the size of the widgets again? Thank You in Advance!
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Django __str__ returned non-string (type NoneType)
- Evil ctypes hack in python
I believe you're looking for the
winfo_reqwidth/reqheight()
methods. These return the required width and height for all the widgets that are children of the widget they're called on. Just plug those into thegeometry()
method the same way you did to go fullscreen on your restore function, like this:Call the geometry with a value of
""
to get it to reset itself to its natural size.Tkinter is based on tk, and the tk docs say this on the matter: