Answers for "know menu's height tkinter"

1

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
Posted by: Guest on October-27-2020

Code answers related to "know menu's height tkinter"

Python Answers by Framework

Browse Popular Code Answers by Language