屏幕

2015-06-21 68 views
5

Python的Tkinter的应用适合我设计了利用Python中的Tkinter模块的应用程序,在我的17" 屏幕。屏幕

有没有一种方法,使这个应用程序适合在较低分辨率的屏幕呢?我曾尝试在14英寸的屏幕上运行它,并且该应用程序不适合。

谢谢。

回答

2

你可以得到屏幕的分辨率,然后将它们输入你的root.geometry,是这样的:

from Tkinker import * 

root = Tk() 

width, height = root.winfo_screenwidth(), root.winfo_screenheight() 

root.geometry('%dx%d+0+0' % (width,height)) 

root.mainloop()