Creating Menus with Menu and Tkinter Dialogs

In this chapter, our simple form will take a big step forward toward being a full-blown application.

As an application grows in functionality, it becomes increasingly counterproductive to cram all its functions and inputs into a single form. Instead, we will need to organize access to features, information, and controls in a way that keeps them available without cluttering up the visual presentation.

GUI toolkits like Tkinter offer us a couple of tools to help deal with this. First, the menu system , typically located at the top of the application window (or, on some platforms, in a global desktop menu), can be used to organize application functions in a condensed hierarchy. Second, dialog windows , often referred to as dialog boxes, provide a quick means of displaying temporary windows containing information, errors, or basic forms.

In this chapter, we're going to explore the use and best practices of menus and dialog boxes in Tkinter through the following topics:

  • In Solving problems in our application, we'll analyze some reported problems with our application and design a solution involving menus and dialog boxes.
  • In Implementing Tkinter dialogs, we'll explore Tkinter's dialog classes and how to use them to implement common application functionality.
  • In Designing the application menu , we'll organize our application's features into a main menu system using Tkinter's Menu widget.

Let's begin by seeing what improvements our application needs.