Struct cursive::menu::MenuTree [] [src]

pub struct MenuTree {
    pub children: Vec<MenuItem>,
}

Root of a menu tree.

Fields

children: Vec<MenuItem>

Menu items

Methods

impl MenuTree
[src]

fn new() -> Self

Creates a new, empty tree.

fn len(&self) -> usize

Returns the number of children, including delimiters.

fn clear(&mut self)

Remove every children from this tree.

fn is_empty(&self) -> bool

Returns true if this tree has no children.

fn add_delimiter(&mut self)

Adds a delimiter to the end of this tree.

fn delimiter(self) -> Self

Adds a delimiter to the end of this tree - chainable variant.

fn add_leaf<F: 'static + Fn(&mut Cursive)>(&mut self, title: &str, cb: F)

Adds a actionnable leaf to the end of this tree.

fn leaf<F>(self, title: &str, cb: F) -> Self where F: 'static + Fn(&mut Cursive)

Adds a actionnable leaf to the end of this tree - chainable variant.

fn add_subtree(&mut self, title: &str, tree: MenuTree)

Adds a submenu to the end of this tree.

fn subtree(self, title: &str, tree: MenuTree) -> Self

Adds a submenu to the end of this tree - chainable variant.

Trait Implementations

impl Default for MenuTree
[src]

fn default() -> MenuTree

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