Menu widget capabilities

The Menu widget, which we learned about in Chapter 6Creating Menus with Menu and Tkinter Dialogs, is different from most other Tkinter widgets in that it relies on the menu facilities of the underlying platform. This allows your application to have a menu that behaves natively; for example, on macOS, the menu appears in the global menu area at the top of the screen, while on Windows it appears in the application window under the taskbar.

Because of this design, there are some limitations when working with cross-platform Menu widgets. To demonstrate this, follow these steps to build a very non-cross-platform menu:

  1. We'll begin by creating a simple Tk window with a menu, with the following code:
import tkinter as ...

Get Python GUI Programming with Tkinter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.