ContextMenu
Attach a right-click menu to child widgets.
Menu items dispatch to Python the same way :class:DropdownMenu items do,
through on_action and last_action.
JupyterLab installs its own context menu on notebook outputs, so a right
click inside Lab opens both menus. Prefer :class:DropdownMenu or
:class:MoreMenu for a notebook-facing menu, and reach for this one when
the output is embedded somewhere Lab does not claim the event.
Notes
See Astryx component docs: https://astryx.atmeta.com/components/ContextMenu.
Functions
constructor__init__(items, children=None, *, size=None, menu_width=None, disabled=False, action_callbacks=None, **props) -> NoneparamitemsIterable[Any]Menu item records. Each item takes a label and a value, and may
set disabled or {"type": "divider"}.
paramchildrenChildInput= NoneThe widgets that respond to a right click.
paramsizestr | None= NoneMenu item size.
parammenu_widthint | None= NoneFixed menu width in pixels.
paramdisabledbool= FalseWhether the menu is suppressed.
paramaction_callbacksIterable[Callable[[ComponentWidget, Any], None]] | None= NonePython callbacks receiving the chosen item value.
parampropsAny= {}Returns
None