pub struct MenuItem<'a> {
pub id: usize,
pub label: String,
pub enabled: bool,
pub key: Key,
pub modifier: usize,
/* private fields */
}
Expand description
Holds info about each item in a menu
Fields§
§id: usize
§label: String
§enabled: bool
§key: Key
§modifier: usize
Implementations§
source§impl<'a> MenuItem<'a>
impl<'a> MenuItem<'a>
sourcepub fn shortcut(self, key: Key, modifier: usize) -> Self
pub fn shortcut(self, key: Key, modifier: usize) -> Self
Sets a shortcut key and modifer (and returns itself)
Examples
menu.add_item("test", 1).shortcut(Key::A, 0).build()
sourcepub fn separator(self) -> Self
pub fn separator(self) -> Self
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
Trait Implementations§
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more