Navigation
Menubars
Present typed top-level, popup, and nested application commands.
The site build compiles the dedicated Ada component example, constructs Menubars through its public API, and exports that exact styled surface. Read the capture source.
When to use it
Use a menubar for global commands that need mnemonics, shortcuts, check items, radio items, and bounded submenus.
State and ownership
The Flyology_TUI.Components.Menubars package defines this component.
The model validates the complete menu graph before changing state and preserves mutable state by stable ID. Presentation revisions reject stale overlay input.
- The application model owner applies updates during serial event dispatch.
- Appearance and skin values are borrowed only while the component renders.
Input and updates
While open, the menubar takes modal routing priority. Keyboard mnemonics and arrows move focus; Enter or Space activates the focused item; Escape closes one menu level. Mouse movement highlights visible items, and a complete press and release activates one.
Integration sequence
- Create the bounded model and populate it with caller-owned data.
- Route the current keyboard or local mouse event through the component handler.
- Apply the typed result, then render from the updated model with the current appearance.
See the linked package reference for its exact declarations and contracts.
Responsive and accessible behavior
- Use dimensions and regions from the current layout or presentation value.
- When a component owns mouse capture, route its matching release even when the pointer leaves the original bounds.
- Retain a glyph, label, border, or text-attribute cue when the terminal reduces color.