O'Reilly logo

Python GUI Programming with Tkinter by Alan D. Moore

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating menus in Tkinter

The tkinter.Menu widget is used to implement menus in Tkinter applications; it's a fairly simple widget that acts as a container for any number of menu items.

The menu items can be one of the following five types:

  • command: These items are labeled buttons that, when clicked, run a callback.
  • checkbutton: These items are just like Checkbutton in our forms, and can be used to toggle BooleanVar.
  • radiobutton: These items are similar to Checkbutton, but can be used to switch any kind of Tkinter variable between several mutually exclusive options.
  • separator: These items are used to segment the menu into sections.
  • cascade: These items allow you to add a submenu to the menu. The submenu is just another tkinter.Menu object. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required