How do I set a minimum window size in tkinter?

后端 未结 4 1064
情歌与酒
情歌与酒 2020-12-09 03:05

My understanding is that after initializing all frames and widgets in the __init__ method, the tkinter window resizes to fit all these components.

I wou

4条回答
  •  无人及你
    2020-12-09 03:31

    I figured it out:

    def __init__(self, master):
        ...
        self.master.update_idletasks()
        self.master.after_idle(lambda: self.master.minsize(self.master.winfo_width(), self.master.winfo_height()))
    

提交回复
热议问题