Struct minifb::MenuItem [] [src]

pub struct MenuItem<'a> {
    pub id: usize,
    pub label: String,
    pub enabled: bool,
    pub key: Key,
    pub modifier: usize,
    // some fields omitted
}

Holds info about each item in a menu

Fields

Methods

impl<'a> MenuItem<'a>
[src]

Creates a new menu item

Sets a shortcut key and modifer (and returns itself)

Examples

menu.add_item("test", 1).shortcut(Key::A, 0).build()

Sets item to a separator

Examples

menu.add_item("", 0).separator().build()

Notice that it's usually easier to just call menu.add_separator() directly

Sets the menu item disabled/or not

Examples

menu.add_item("test", 1).enabled(false).build()

Must be called to finalize building of a menu item when started with menu.add_item()

Examples

menu.add_item("test", 1).enabled(false).build()

Trait Implementations

impl<'a> Default for MenuItem<'a>
[src]

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

impl<'a> Clone for MenuItem<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more