Menubar
管理窗口内的水平菜单栏及其菜单项。
正在加载交互演示…
let bar = Menubar::new("app");
bar.root().flex_row()#导入
从 quickgui 导入 Menubar。
use quickgui::*;#用法
let bar = Menubar::new("app");
bar.root().flex_row()#结构
Menubar::rootMenubar::item
#API 参考
展开条目查看说明和完整签名。短横线表示声明中未记录默认值。
Menubar
查看源码pub 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>查看源码Menubar::root_with
查看源码pub fn root_with(self, state: MenubarState, root: Element) -> ElementDecorate an application-owned menubar root without adding layout or appearance.
Menubar::root
查看源码pub fn root(self, state: MenubarState) -> ElementCreate the unstyled root part. Use [`Self::root_with`] to supply an existing element.
