[−][src]Struct minifb::MenuItem
Holds info about each item in a menu
Fields
id: usize
label: String
enabled: bool
key: Key
modifier: usize
Methods
impl<'a> MenuItem<'a>
[src]
pub fn new(name: &str, id: usize) -> MenuItem
[src]
Creates a new menu item
pub fn shortcut(self, key: Key, modifier: usize) -> Self
[src]
Sets a shortcut key and modifer (and returns itself)
Examples
menu.add_item("test", 1).shortcut(Key::A, 0).build()
pub fn separator(self) -> Self
[src]
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
pub fn enabled(self, enabled: bool) -> Self
[src]
pub fn build(&mut self) -> MenuItemHandle
[src]
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> Clone for MenuItem<'a>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Debug for MenuItem<'a>
[src]
impl<'a> Default for MenuItem<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for MenuItem<'a>
impl<'a> !Send for MenuItem<'a>
impl<'a> !Sync for MenuItem<'a>
impl<'a> Unpin for MenuItem<'a>
impl<'a> !UnwindSafe for MenuItem<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,