pub struct MenuEvent {
pub id: MenuId,
pub source: SurfaceId,
}Expand description
Emitted when a row is activated (click, Enter, or AXPress).
Fields§
§id: MenuIdThe MenuId of the activated row.
source: SurfaceIdWhich surface — Tray, ContextMenu,
or Popup — the activation came from (issue #51). A
consumer with more than one live surface uses this to tell them apart on
the process-global channel; the muda-compat facade ignores it (structural
MenuId equality is unaffected).
Implementations§
Source§impl MenuEvent
impl MenuEvent
Sourcepub fn receiver() -> &'static MenuEventReceiver
pub fn receiver() -> &'static MenuEventReceiver
The process-global receiver for menu activations, created lazily on first
use. A migrated muda app polls this exactly as it polled
muda::MenuEvent::receiver().
Sourcepub fn set_event_handler<F>(handler: Option<F>)
pub fn set_event_handler<F>(handler: Option<F>)
Install (or clear, with None) a global handler invoked for every
activation. Mirrors muda’s escape hatch for apps that forward events into
their own loop (tao/tauri) rather than polling the receiver. Runs after
the event is placed on the channel.
Generic over the closure type, exactly like muda::MenuEvent::set_event_handler,
so a migrated app’s bare-closure call compiles unchanged. Clear with a
type-annotated None, e.g. set_event_handler(None::<fn(MenuEvent)>).