I am trying to set the minimum size of the window.
I followed the solution posted on How do I set a minimum window size in tkinter?
However, that doesn't take account of the height of the Menu I have.
The Menu code I have is:
menubar = tk.Menu(self)
menu = tk.Menu(menubar, tearoff=0)
menu.add_command(label="Change user name", \
command=self.prompt_new_name)
menu.add_separator()
menu.add_command(label="Exit", command=self.close_app)
menubar.add_cascade(label="Menu", menu=menu)
self.master.config(menu=menubar)
And the way how I am setting the minimum size is:
master = self.master
master.update()
print(master.winfo_height())
print(menubar.winfo_height())
master.minsize(master.winfo_width(), master.winfo_height())
master.winfo_height() looks like it returns the height of the window as if there was no Menu widget. I tried printing the height of menubar but it returns 1.
How do I get the height of the window including the menu or only get the height of the menu separately so I can add it to the master.winfo_height() and set that as the minsize?