I need a Python script that uses the Tkinter module to create a static (not resizable) window.
I have a pretty simple Tkinter script but I don\'t want it to be resizable
yups!!!, I have the solution, tkinter has resizable function which helps here. just use
from tkinter import *
gui = Tk()
gui.title("Tkinter window")
gui.geometry("370x250")
gui.resizable(False,False)
gui.mainloop()
The resizable
method on the root window takes two boolean parameters to describe whether the window is resizable in the X and Y direction. To make it completely fixed in size, set both parameters to False
:
root.resizable(False, False)