To create menu and message widget in python3.
It is used to create all kinds of menus used by the application.
Syntax:
M=Menu(root, options=value)
The widget can be used to display short text messages.
Syntax:
M=Message(root, options=value)
#import tkinter
import tkinter as tk
from tkinter import *
#root window
root = tk.Tk()
menu = Menu(root)
root.config(menu=menu)
#menu widget
filemenu = Menu(menu)
menu.add_cascade
(label=’File’, menu=filemenu)
filemenu.add_command(label=’New’)
filemenu.add_command(label=’Open’)
filemenu.add_separator()
filemenu.add_command
(label=’Exit’, command=root.quit)
helpmenu = Menu(menu)
menu.add_cascade
(label=’Help’, menu=helpmenu)
helpmenu.add_command
(label=’About’)
tk.mainloop()