Creating a menu bar
Complex GUIs typically use menu bars to organize the actions and navigations that are available in our application. This pattern is also used to group operations that are closely related, such as the File
menu included in most text editors.
Tkinter natively supports these menus, which are displayed with the look and feel of the target desktop environment. Therefore, you do not have to simulate them with frames or labels, because you would lose the cross-platform features that have already been built into Tkinter.
Getting ready
We will start by adding a menu bar to a root window with a nested drop-down menu. On Windows 10, this is displayed as follows:

How to do it...
Tkinter has a Menu
widget class that can be used for many kinds of menus, including top menu bars. As any other widget classes, menus are instantiated with the parent container as the first argument and some optional configuration options:
import tkinter as tk class App(tk.Tk): def __init__(self): ...