1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
root_gui=Tk()
menubar = Menu(root_gui)
# create a pulldown menu, and add it to the menu bar
filemenu = Menu(menubar, tearoff=0)
filemenu.add_command(label="New", command=newproject)
filemenu.add_command(label="Open", command=openncf)
filemenu.add_command(label="Save", state=DISABLED, command=write_project_ncf)
filemenu.add_command(label="Save_As", command=saveasncf)
filemenu.add_separator()
filemenu.add_command(label="Exit", command=root_gui.quit)
menubar.add_cascade(label="File", menu=filemenu)
# create more pulldown menus
editmenu = Menu(menubar, tearoff=0)
editmenu.add_command(label="Configure Project", state=DISABLED, command=newproject)
editmenu.add_command(label="Configure Interface", command=cfginterface)
menubar.add_cascade(label="Edit", menu=editmenu) |
Partager