How to make a Tkinter window not resizable?

前端 未结 2 909
囚心锁ツ
囚心锁ツ 2021-02-01 13:52

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

相关标签:
2条回答
  • 2021-02-01 14:18

    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()
    
    0 讨论(0)
  • 2021-02-01 14:20

    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)
    
    0 讨论(0)
提交回复
热议问题