know menu 27s height tkinter

Solutions on MaxInterview for know menu 27s height tkinter by the best coders in the world

showing results for - "know menu 27s height tkinter"
Fatima
08 Apr 2020
1import tkinter as tk
2
3#Init the window
4window = tk.Tk()
5
6#Creation and attachment of the Menu to the window
7menuBar = tk.Menu(window)
8window.config(menu = menuBar)
9
10#Access to the menu's size in pixels wherever you are (in a function for example)
11menuHeight = window.winfo_children()[3].winfo_reqheight() #Height of the menu
12menuWidth = window.winfo_children()[3].winfo_reqwidth() #Width of the menu