pub struct MenuItem { /* private fields */ }Expand description
An entry of a Menu: a command, a submenu or a separator.
Implementations§
Source§impl MenuItem
impl MenuItem
Sourcepub fn new(label: impl Into<String>, command: u32) -> Self
pub fn new(label: impl Into<String>, command: u32) -> Self
A command labeled label: choosing it reports ActionKind::Command(command).
An entry that opens items beside it.
Sourcepub fn with_shortcut(self, shortcut: impl Into<String>) -> Self
pub fn with_shortcut(self, shortcut: impl Into<String>) -> Self
Shows shortcut (such as “Ctrl+C”) at the right of a command. It is only shown: the
application handles the keys.
Trait Implementations§
impl StructuralPartialEq for MenuItem
Auto Trait Implementations§
impl Freeze for MenuItem
impl RefUnwindSafe for MenuItem
impl Send for MenuItem
impl Sync for MenuItem
impl Unpin for MenuItem
impl UnsafeUnpin for MenuItem
impl UnwindSafe for MenuItem
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