Struct cursive::views::Menubar [] [src]

pub struct Menubar {
    pub menus: Vec<(String, Rc<MenuTree>)>,
    pub autohide: bool,
    // some fields omitted
}

Shows a single-line list of items, with pop-up menus when one is selected.

The Cursive root already includes a menubar that you just need to configure.

Fields

menus: Vec<(String, Rc<MenuTree>)>

Menu items in this menubar.

autohide: bool

TODO: move this out of this view.

Methods

impl Menubar
[src]

fn new() -> Self

Creates a new, empty menubar.

fn receive_events(&self) -> bool

True if we should be receiving events.

fn visible(&self) -> bool

Returns true if we should be drawn.

fn add(&mut self, title: &str, menu: MenuTree) -> &mut Self

Adds a new item to the menubar.

The item will use the given title, and on selection, will open a popup-menu with the given menu tree.

Trait Implementations

impl Default for Menubar
[src]

fn default() -> Self

Returns the "default value" for a type. Read more

impl View for Menubar
[src]

fn draw(&self, printer: &Printer)

Draws the view with the given printer (includes bounds) and focus.

fn on_event(&mut self, event: Event) -> EventResult

Called when a key was pressed. Default implementation just ignores it.

fn take_focus(&mut self, _: Direction) -> bool

This view is offered focus. Will it take it? Read more

fn get_min_size(&mut self, _: Vec2) -> Vec2

Returns the minimum size the view requires with the given restrictions. Read more

fn needs_relayout(&self) -> bool

Returns true if the view content changed since last layout phase. Read more

fn layout(&mut self, Vec2)

Called once the size for this view has been decided, Read more

fn find(&mut self, &Selector) -> Option<&mut Any>

Finds the view pointed to by the given path. Read more