Python‎ > ‎tkinter‎ > ‎

tkinter.Menu


Definition
The Menu widget displays the Menu bar, pull-down menu and pop up menu.

Syntax
tkinter.Menu()
Menu()

Option
Menu(activebackground, activeborderwidth, activeforeground, background, bd, bg, borderwidth, cursor, 
disabledforeground, fg, font, foreground, postcommand, relief,  selectcolor, takefocus, tearoff, tearoffcommand, title, type.)

Examples
The Menu was created through Menu() and configure in the Tk() widget.
from tkinter import*

master=Tk()

menu1=Menu(master)

menu.add_command(label="Menu # 1")
menu.add_command(label="Menu # 2")
menu.add_command(label="Menu # 3")
menu.add_command(label="Menu # 4")
menu.add_command(label="Menu # 5")
menu.add_command(label="Menu # 6")

master.config(m=menu)





tkinter


Comments