CLASS
A menu is a collection of buttons, organized in sections and submenus.
The menu for macOS.
The menu's content for macOS.
The menu for Linux.
The menu's content for Linux.
Initialize a menu.
Add a button to a menu.
- Parameters:
- label: The button's label.
- app: The application.
- shortcut: The button's keyboard shortcut.
- handler: Handle the action when the button is clicked or the shortcut is pressed.
- Returns: The menu.
Add a button to a menu that runs an action specified in the menu bar or the app's actions.
- Parameters:
- label: The button's label.
- app: The application.
- id: The label of the button that holds the original action.
- Returns: The menu.
Add a section to a menu.
- Parameter menu: The menu in the section.
- Returns: The menu.
Add another menu inside this menu.
- Parameters:
- label: The child menu's title.
- menu: The child menu.
- Returns: The parent menu.
Get the NSMenu
.
- Returns: The
NSMenu
.
Get the Libadwaita.Menu
.
- Returns: The
Libadwaita.Menu
.