kyra
0
Q:

know menu's height tkinter

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
0

New to Communities?

Join the community