Python Tkinter Menu

This Article covers the use of a Menu in Tkinter Python.

What is the Python Tkinter Menu?

The Python Tkinter Menu widget is used to create various types of menus in the GUI such as top-level menus, which are displayed right under the title bar of the parent window.


Syntax

menu = Menu(master, options..........)   

Fair warning before you proceed any further. Creating a fully fledged menu for your GUI application is considerably harder than the average widget due to the sheer size. A Tkinter Menu can be thought as a collection of many other widgets bundled into one.

The plus side is that using Menu’s properly in your GUI application significantly improves the functionality and makes it seem professional.


Menu Options:

A list of the most relevant options in Tkinter Menu’s.

No.OptionDescription
1activebackground Color of the background when widget is under focus.
2activeforeground Color of the foreground when widget in under focus.
3bg Background color for the area around the widget.
4bd Size of the border around the widget. Default value is 2 pixels.
5cursor When the mouse is hovering over this widget, it can be changed to a special cursor type like an arrow or dot.
6disabledforeground Color of text for DISABLED items.
7font The type of font to be used for this widget.
8fg