How to make a Tkinter window not resizable?

前端 未结 2 910
囚心锁ツ
囚心锁ツ 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: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)
    

提交回复
热议问题