Sigil

Menu bar

An in-window menu bar, as wide as its menus.

fill makes it take the full width.

GUITUIRuns in the browsermenu_bar

Preview

Menu bar, Open, light themeMenu bar, Open, dark theme

Usage example

fn menu_bar_demo() -> MenuBarBuilder {    menu_bar().fill().menu(        "File",        [            MenuItem::new("New").activate(|| {}),            MenuItem::new("Open").shortcut("Ctrl+O").activate(|| {}),            MenuItem::new("Quit").shortcut("Ctrl+Q").activate(|| {}),        ],    )}
fn menu_bar_demo() -> MenuBarBuilder {  menu_bar().fill().menu(    "File",    [      MenuItem::new("New")        .activate(|| {}),      MenuItem::new("Open")        .shortcut("Ctrl+O")        .activate(|| {}),      MenuItem::new("Quit")        .shortcut("Ctrl+Q")        .activate(|| {}),    ],  )}

States

All 4 captured states, each drawn by the window host and by the terminal host.

  • Menu bar, Default, light themeMenu bar, Default, dark theme
    Default
  • Menu bar, Hover, light themeMenu bar, Hover, dark theme
    Hover
  • Menu bar, Pressed, light themeMenu bar, Pressed, dark theme
    Pressed
  • Menu bar, Open, light themeMenu bar, Open, dark theme
    Open

API

NameSignaturePurpose
menu_bar`fn menu_bar() -> MenuBarBuilder`; `.fill()`An in-window menu bar, as wide as its menus. fill makes it take the full width.