import tkinter as tk #Init the window window = tk.Tk() #Creation and attachment of the Menu to the window menuBar = tk.Menu(window) window.config(menu = menuBar) #Access to the menu's size in pixels wherever you are (in a function for example) menuHeight = window.winfo_children()[3].winfo_reqheight() #Height of the menu menuWidth = window.winfo_children()[3].winfo_reqwidth() #Width of the menu
Here is what the above code is Doing:
1. Create a menu bar
2. Attach the menu bar to the window
3. Get the height and width of the menu bar