主题
ContextMenuSelectEvent 继承自: ContextMenuDismissEvent, Event['ContextMenu']
Event fired when a ContextMenu item is selected.
属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
item_id | Optional[int] | None | Internal numeric identifier of the selected menu item. |
item_index | Optional[int] | None | Index of the selected menu entry within the rendered list. |
global_position | Offset | metadata={'data_field': 'g'} | Global pointer position in logical pixels. |
local_position | Optional[Offset] | None | Local pointer position relative to the wrapped control. |
button | Optional[str] | None | Mouse button that triggered the menu. If a string, can be one of: "primary" (linked to primary_items), "secondary" (linked to secondary_items), or "tertiary" (linked to tertiary_items). |
trigger | Optional[ContextMenuTrigger] | None | The trigger mode that opened the menu. |
item_count | Optional[int] | None | Total number of entries displayed in the corresponding context menu. |
只读属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
item | Optional[PopupMenuItem] | — | The selected menu item. |