update example_005
This commit is contained in:
parent
d3e5694bf6
commit
0564517d70
|
@ -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()
|
Loading…
Reference in New Issue