update example_005

This commit is contained in:
Joachim Lusiardi 2019-08-10 12:07:06 +02:00
parent d3e5694bf6
commit 0564517d70
1 changed files with 23 additions and 0 deletions

23
example_005.py Normal file
View File

@ -0,0 +1,23 @@
# example_005.py
from tkinter import Tk, Menu
def main():
root = Tk()
menu_bar = Menu(root)
root.config(menu=menu_bar)
file_menu = Menu(menu_bar, tearoff=0)
menu_bar.add_cascade(label="File", menu=file_menu)
file_menu.add_command(label="Open")
file_menu.add_separator()
file_menu.add_command(label="Exit", command=root.quit)
help_menu = Menu(menu_bar, tearoff=0)
menu_bar.add_cascade(label="Help", menu=help_menu)
root.mainloop()
if __name__ == '__main__':
main()