Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个可以调整大小的 gui 窗口。我想设置最小调整值(以及最大值),这样当窗口太小时我的小部件不会被吞没,或者在调整太大时应用程序看起来不会难看。
如何设置主窗口的最小和最大调整大小?
您可以使用minsize和maxsize功能:
minsize
maxsize
from Tkinter import * root = Tk() root.minsize(width=200, height=200) root.maxsize(width=650, height=500) root.mainloop()