python - Tkinter 几何恢复正常

标签 python python-3.x tkinter geometry fullscreen

我有一个 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/

相关文章:

python - .png 是 python 的 tkinter 模块唯一可接受的格式吗?

python - 在 for 循环中使用生成器 send()

python - 使用标识符之间的关系创建数组

python - 如何使用 telnetlib 打印 "tar"执行的输出,直到它完成?

python - 如何在Python中模拟一系列用户输入

python-3.x - numpy.loadtxt 无法在 Python 3 中读取 int

python - 如何在没有大括号或附加符号的情况下将值插入 tkinter 条目?

python-3.x - 如何使用 tkinter 在 python 上播放声音

c# - IronPython 用于 C# 上的单元测试

python - numpy数组维度不匹配错误