S or /

SourceClass SubMenu

from egui import SubMenu
class SubMenu:

Show a submenu in a menu.

Useful if you want to make custom menu buttons. Usually, just use MenuButton or SubMenuButton instead.

Methods§

Sourcedef config(self, /, config: MenuConfig) -> SubMenu§

Set the config for the submenu.

The close behavior will not affect the current button, but the buttons in the submenu.

@staticmethod def default() -> SubMenu§
Source@staticmethod def id_from_widget_id(widget_id: Id) -> Id§

Get the id for the submenu from the widget/response id.

Sourcedef show(self, /, button_response: Response) -> Any§

Show the submenu.

This does some heuristics to check if the button_response was the last thing in the menu that was hovered/clicked, and if so, shows the submenu.