Guide API
Skip to main content

handle_event

Function handle_event 

Source
pub fn handle_event(mv: &MenuViewState, ev: &mut Event, ctx: &mut Context<'_>)
Expand description

The passive event layer of a menu view.

Reads mv.menu + mv.state.id() and posts / requests through ctx; it does not mutate the menu (regray is routed through the command-set broker). The interactive activation branches (opening a menu, navigating it) live in the menu session, so this function leaves an activation event for the session.

Handled branches:

  • a command-set-changed broadcast → request the regray broker by the view’s own id (Context::request_update_menu).
  • a key press → an accelerator match posts the item’s command and clears the event (hot_key); a bar hotkey opens the menu session instead.

§Turbo Vision heritage

Ports the passive subset of TMenuView::handleEvent (tmnuview.cpp); the interactive subset is flattened into the menu session (deviation D9).