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.
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()
You need to use this one line:
root.state('zoomed') #works on all operating systems
root = tkinter.Tk()
root.state('zoomed')
This will fit the window perfectly to the display. (Note: This is not full screen function. Full screen means the window will also cover the taskbar, but in this code window fits all over the screen except the taskbar)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With