S or /

SourceClass MenuState

from egui import MenuState
class MenuState:

Holds the state of the menu.

Properties§

@property def open_item(self, /) -> Id |None§
@open_item.setter def open_item(self, /, open_item: Id |None) -> None§

Methods§

Source@staticmethod def from_id(ctx: Context, id: Id) -> MenuState§

Get the state via the menus root Ui id

Source@staticmethod def from_ui(ui: Ui) -> MenuState§

Find the root of the menu and get the state

Source@staticmethod def is_deepest_open_sub_menu(ctx: Context, id: Id) -> bool§

Is the menu with this id the deepest sub menu? (-> no child sub menu is open)

Note: This only returns correct results if called after the menu contents were shown.

Source@staticmethod def mark_shown(ctx: Context, id: Id) -> None§