Expand description
Menu action dispatch (§ menus). The MODEL (day_spec::MenuItem) is toolkit-neutral and carries
only ids for its actions; the real closures live here, keyed by id. A backend fires
Event::MenuAction(id) when a native item is chosen; the event pump routes it to
dispatch_menu_action, which runs the app’s closure. Ids are process-unique and monotonic.
Enums§
- Menu
BarStyle - Arrange an app’s top-level menus into the platform’s standard bar, filling every standard slot the app did not claim with the backend’s stock menu.
Functions§
- app_
menu_ installed - Whether any app menu was installed (an empty model = the backend default menu is up).
- app_
menu_ model - The app menu as last installed (post-injection). The dayscript
menu:step walks it to resolve an item’s dispatch id; backends re-read it on late preferences registration. - dispatch_
menu_ action - Run the closure registered for
id(no-op if none). Called by the event pump onEvent::MenuAction. Runs inside a reactive batch so multiple signal writes coalesce. - register_
menu_ action - Register an app closure for a menu item and return its dispatch id (nonzero). The
day-piecesmenu builder calls this while lowering a menu tree to theday_spec::MenuItemmodel. - set_
app_ menu - Set the application menu (menu bar / app-bar overflow / iPad main menu). Retains the
model (post-injection —
app_menu_model), injects the auto Preferences item when one is registered (docs/windows.md), drops the PREVIOUS app menu’s action closures (context menus share the map and are untouched), and forwards to the backend. - standard_
menu_ bar leadingare the slots before the app’s own menus andtrailingthe ones after — each backend passes its platform’s bar (macOS trails Window and Help; KDE trails Settings and Help; GNOME and Windows trail Help alone).stockreturns the backend’s house version of a slot, orNonewhere that platform has no such menu. Menus the app tagged with [MenuBarRole] replace the stock one IN PLACE, so an app customizes a standard menu by claiming it rather than by rebuilding the whole bar.- standard_
menu_ bar_ for - Assemble the bar for a desktop’s conventions —
standard_menu_barwith that style’s slot order and stock menus.