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

前端 未结 6 1349
野趣味
野趣味 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 04:07

    Traceback (most recent call last):
      File "tkwindowwithlabel5.py", line 23, in 
        main()
      File "tkwindowwithlabel5.py", line 16, in main
        window.resizeable(width = True, height =True)
      File "/usr/lib/python3.4/tkinter/__init__.py", line 1935, in                
      __getattr__
        return getattr(self.tk, attr)
    AttributeError: 'tkapp' object has no attribute 'resizeable'
    

    is what you will get with the first answer. tk does support min and max size

    window.minsize(width = X, height = x)
    window.maxsize(width = X, height = x)
    

    i figured it out but just trying the first one. using python3 with tk.

提交回复
热议问题