A popup menu shown on UIRoot.popupLayer behind a click-blocking backdrop. Used by UIMenuBar dropdowns and directly for right-click context menus. Escape or an outside click closes it; selecting an item closes then runs its callback.

Static variables

@:value(null)staticread onlycurrent:UIContextMenu = null

The open menu, if any (one at a time).

@:value(230)staticmenuWidth:Float = 230

Menu panel width.

Static methods

staticopen(x:Float, y:Float, items:Array<UIMenuItem>):UIContextMenu

Opens a menu, closing any menu already open.

Parameters:

x

the menu's left edge in root coordinates (clamped inside the window)

y

the menu's top edge in root coordinates (clamped inside the window)

items

the entries (separators render as dividers)

Returns:

the opened menu (assign onClosed for close notifications)

Variables

@:value(null)onClosed:() ‑> Void = null

Fired when the menu closes (any reason).

Methods

close():Void

Closes and disposes the menu.