Widget.showContextMenu

Shows the widget's context menu, as if the user right clicked at the x, y position. You should rarely, if ever, have to call this, since default event handlers will do it for you automatically. To control what menu shows up, you can pass one as menuToShow, but if you don't, it will call contextMenu, which you can override on a per-widget basis.

class Widget
final
bool
showContextMenu
(
int x
,
int y
,
Menu menuToShow = null
)

Meta

History

The menuToShow parameter was added on March 19, 2025.