S or /

SourceModule menu

Popup menus, context menus and menu bars.

Show menus via - Popup.menu and Popup.context_menu - Ui.menu_button, MenuButton and SubMenuButton - MenuBar - Response.context_menu

See MenuBar for an example.

Classes§

MenuBar

Horizontal menu bar where you can add MenuButtons.

MenuButton

A thin wrapper around a Button that shows a Popup.menu when clicked.

MenuConfig

Configuration and style for menus.

MenuState

Holds the state of the menu.

SubMenu

Show a submenu in a menu.

SubMenuButton

A submenu button that shows a SubMenu if a Button is hovered.

Functions§

find_menu_root

Find the root UiStack of the menu.

is_in_menu

Is this Ui part of a menu?

menu_style

Apply a menu style to the Style.

SourceFunction find_menu_root§

from egui import find_menu_root
def find_menu_root(ui: Ui) -> UiStack

Find the root UiStack of the menu.

SourceFunction is_in_menu§

from egui import is_in_menu
def is_in_menu(ui: Ui) -> bool

Is this Ui part of a menu?

Returns False if this is a menu bar. Should be used to determine if we should show a menu button or submenu button.

SourceFunction menu_style§

from egui import menu_style
def menu_style(style: Style) -> None

Apply a menu style to the Style.

Mainly removes the background stroke and the inactive background fill.

Constants§

Re-exports§