Menubar
Coordinates a horizontal in-window menubar and its menu items.
Loading interactive demo…
let bar = Menubar::new("app");
bar.root().flex_row()#Import
Import Menubar from quickgui.
use quickgui::*;#Usage
let bar = Menubar::new("app");
bar.root().flex_row()#Anatomy
Menubar::rootMenubar::item
#API reference
Expand an entry for its description and complete signature. A dash means no declaration default is documented.
Menubar
View sourcepub fn new(root_id: impl Into<ElementId>) -> Selfroot_idpub const fn root_id(self) -> ElementId—
item_idpub fn item_id(self, index: usize) -> ElementId—
itempub const fn item(self, state: MenubarState, index: usize) -> Option<MenubarItem>—
Describe one top-level menu trigger. Indices at or past [`MenubarState::menu_count`] return `None`, so a caller-driven loop stays bounded by the state instead of by its own arithmetic.
pub const fn item(self, state: MenubarState, index: usize) -> Option<MenubarItem>View sourceMenubar::root_with
View sourcepub fn root_with(self, state: MenubarState, root: Element) -> ElementDecorate an application-owned menubar root without adding layout or appearance.
Menubar::root
View sourcepub fn root(self, state: MenubarState) -> ElementCreate the unstyled root part. Use [`Self::root_with`] to supply an existing element.
