Struct minifb::Menu [] [src]

pub struct Menu(_);

Menu holds info for menus

Methods

impl Menu
[src]

fn new(name: &str) -> Result<Menu>

Create a new menu. Returns error if failed

fn destroy_menu(&mut self)

Destroys a menu. Currently not implemented

fn add_sub_menu(&mut self, name: &str, menu: &Menu)

Adds a sub menu to the current menu

fn add_separator(&mut self)

Adds a menu separator

fn add_menu_item(&mut self, item: &MenuItem) -> MenuItemHandle

Adds an item to the menu

fn add_item(&mut self, name: &str, id: usize) -> MenuItem

Adds an item to the menu. Notice that you need to call "build" to finish the add

Examples

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

fn remove_item(&mut self, item: &MenuItemHandle)

Removes an item from the menu