How can I prevent a window from being resized with tkinter?

前端 未结 6 1342
野趣味
野趣味 2020-12-01 03:18

I have a program which creates a window where a message is displayed according to a check box.

How can I make the window size constant when the message is displayed

6条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-01 03:57

    This is a variant of an existing solution already provided above:

    import tkinter as tk
    
    root = tk.Tk()
    root.resizable(0, 0)
    root.mainloop()
    

    The advantage is that you type less.

提交回复
热议问题