Python Tkinter application fit on screen

社会主义新天地 提交于 2020-01-14 08:07:26

问题


I have designed an application using the Tkinter module from Python, on my 17" screen.

Is there a way to make this app fit on lower resolution screens? I have tried to run it on a 14" screen, and the app doesn`t fit well.

Thank you.


回答1:


You can get the screen resolution then input them in your root.geometry, this way:

from Tkinker import *

root = Tk()

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

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

root.mainloop()


来源:https://stackoverflow.com/questions/30965033/python-tkinter-application-fit-on-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!