from Tkinter import * def filemenu(): filewin = Toplevel(root) fileclose = Button(filewin, text="Close Application") fileclose.config(command=root.quit) fileclose.pack() root = Tk() menubar = Menu(root) menubar.add_command(label="File", command=filemenu) menubar.add_command(label="Help") root.config(menu=menubar) root.mainloop()
18.20.Menu | ||||
18.20.1. | File menu | |||
18.20.2. | MenuBars with Chioces | |||
18.20.3. | Menu command | |||
18.20.4. | Add Menu item by adding command | |||
18.20.5. | Starndard File Menu | |||
18.20.6. | Context Menus | |||
18.20.7. | Add action command to menu item | |||
18.20.8. | Frame-based menus: for top-levels and components | |||
18.20.9. | 3 menus nested in the containers | |||
18.20.10. | 2 menus nested in one window | |||
18.20.11. | Tk8.0 style top-level window menus | |||
18.20.12. | 3 popup windows with menus | |||
18.20.13. | Option menu |