我有一个 tkinter 窗口,可以使用geometry(width+height)
和 overrideredirect(True)
使其全屏显示,但现在当我返回窗口时回到正常大小并执行命令 overrideredirect(False)
,我似乎无法让窗口自动跟随其中的小部件的大小,就像我不更改大小一样。您知道有什么方法可以让窗口再次自动跟随小部件的大小吗?预先感谢您!
最佳答案
使用值""
调用几何图形,使其重置为其自然大小。
Tkinter 基于 tk,tk docs就此事说一下:
If newGeometry is specified as an empty string then any existing user-specified geometry for window is cancelled, and the window will revert to the size requested internally by its widgets.
关于python - Tkinter 几何恢复正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23853575/