Search code examples
pythontkinterfullscreentk-toolkitttk

Set fixed size and disable resizing, tkinter maximize window and restore window


i'm having an issue with this code i want to set a fixed window size and disable resizing, once it restored from zoomed

My code :

from tkinter import *

root = Tk()

w = root.winfo_screenwidth()
w = w - 200

h = root.winfo_screenheight()
h = h - 500

root.geometry(f'{w}x{h}+0+0')

root.state("zoomed")


root.mainloop()

Solution

  • To disable resizing, you use this function

    root.resizable(False, False) 
    

    Let me know if that works for you.