tkinter:如何修复窗口,以便当我的内容调整大小时窗口不会调整大小?
我有一种感觉,这与我的 pack() 函数有关。窗口总是将内容“打包”到可能的最小尺寸,但由于内容总是在变化,窗口大小也总是在变化,这会移动居中的按钮。
我希望窗口始终保持一定的尺寸,例如 200x200。问题是,窗口根据显示的文本量不断调整大小,并且它使按下按钮变得困难,因为它总是在移动。
如果您想查看它的实际效果,我的代码在这里: http://pastebin.com/PQWMiqYQ
如果有人请告诉我可以实现哪些代码来使窗口大小恒定,我们将不胜感激。
谢谢!
I have a feeling it is to do with my pack() function. The window always "packs" the content in to the smallest size it can possibly be, but because the content is always changing, the window size is always changing and this moves the button, which is centred.
I want the window to stay at a certain size the whole time, e.g. 200x200. The problem is, the window keeps resizing according to how much text is shown, and it makes pushing the button hard because it's always moving.
If you want to see it in action, my code is here: http://pastebin.com/PQWMiqYQ
If someone could please tell me what code I can implement to make the window size constant, that would be much appreciated.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以这样做:
You can do: