Skip to main content

ContextMenuDismissEvent

Event fired when a ContextMenu is dismissed.

Inherits: Event

Properties

  • button - Mouse button that triggered the menu.
  • global_position - Global pointer position in logical pixels.
  • item_count - Total number of entries displayed in the corresponding context menu.
  • local_position - Local pointer position relative to the wrapped control.
  • trigger - The trigger mode that opened the menu.

Properties

buttonclass-attributeinstance-attribute

button: str | None = field(
    default=None, metadata={"data_field": "b"}
)

Mouse button that triggered the menu.

If a string, can be one of: "primary" (linked to ContextMenu.primary_items), "secondary" (linked to ContextMenu.secondary_items), or "tertiary" (linked to ContextMenu.tertiary_items).

global_positionclass-attributeinstance-attribute

global_position: Offset = field(
    metadata={"data_field": "g"}
)

Global pointer position in logical pixels.

item_countclass-attributeinstance-attribute

item_count: int | None = field(
    default=None, metadata={"data_field": "ic"}
)

Total number of entries displayed in the corresponding context menu.

local_positionclass-attributeinstance-attribute

local_position: Offset | None = field(
    default=None, metadata={"data_field": "l"}
)

Local pointer position relative to the wrapped control.

triggerclass-attributeinstance-attribute

trigger: ContextMenuTrigger | None = field(
    default=None, metadata={"data_field": "tr"}
)

The trigger mode that opened the menu.