pub struct MenuItem<'ui, Label, Shortcut = &'static str> { /* private fields */ }
Expand description
Builder for a menu item.
Implementations§
source§impl<'ui, Label: AsRef<str>, Shortcut: AsRef<str>> MenuItem<'ui, Label, Shortcut>
impl<'ui, Label: AsRef<str>, Shortcut: AsRef<str>> MenuItem<'ui, Label, Shortcut>
sourcepub fn shortcut<Shortcut2: AsRef<str>>(
self,
shortcut: Shortcut2
) -> MenuItem<'ui, Label, Shortcut2>
pub fn shortcut<Shortcut2: AsRef<str>>( self, shortcut: Shortcut2 ) -> MenuItem<'ui, Label, Shortcut2>
Sets the menu item shortcut.
Shortcuts are displayed for convenience only and are not automatically handled.
sourcepub fn selected(self, selected: bool) -> Self
pub fn selected(self, selected: bool) -> Self
Sets the selected state of the menu item.
Default: false
sourcepub fn build_with_ref(self, selected: &mut bool) -> bool
pub fn build_with_ref(self, selected: &mut bool) -> bool
Builds the menu item using a mutable reference to selected state.