S or /

SourceClass MenuButton

from egui import MenuButton
class MenuButton:

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

The only thing this does is search for the current menu config (if set via MenuBar). If your menu button is not in a MenuBar it's fine to use Ui.button and Popup.menu directly.

Methods§

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

Set the config for the menu.

Source@staticmethod def from_button(button: Button) -> MenuButton§

Create a new menu button from a Button.

def show(self, /) -> Any§
Sourcedef ui(self, /) -> Any§

Show the menu button.