Struct arcdps_imgui::MenuItem
source · pub struct MenuItem<Label, Shortcut = &'static str> { /* private fields */ }
Expand description
Builder for a menu item.
Implementations§
source§impl<Label: AsRef<str>, Shortcut: AsRef<str>> MenuItem<Label, Shortcut>
impl<Label: AsRef<str>, Shortcut: AsRef<str>> MenuItem<Label, Shortcut>
sourcepub fn shortcut<Shortcut2: AsRef<str>>(
self,
shortcut: Shortcut2,
) -> MenuItem<Label, Shortcut2>
pub fn shortcut<Shortcut2: AsRef<str>>( self, shortcut: Shortcut2, ) -> MenuItem<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(self, ui: &Ui<'_>) -> bool
pub fn build(self, ui: &Ui<'_>) -> bool
Builds the menu item.
Returns true if the menu item is activated.
sourcepub fn build_with_ref(self, ui: &Ui<'_>, selected: &mut bool) -> bool
pub fn build_with_ref(self, ui: &Ui<'_>, selected: &mut bool) -> bool
Builds the menu item using a mutable reference to selected state.
Trait Implementations§
impl<Label: Copy, Shortcut: Copy> Copy for MenuItem<Label, Shortcut>
Auto Trait Implementations§
impl<Label, Shortcut> Freeze for MenuItem<Label, Shortcut>
impl<Label, Shortcut> RefUnwindSafe for MenuItem<Label, Shortcut>where
Label: RefUnwindSafe,
Shortcut: RefUnwindSafe,
impl<Label, Shortcut> Send for MenuItem<Label, Shortcut>
impl<Label, Shortcut> Sync for MenuItem<Label, Shortcut>
impl<Label, Shortcut> Unpin for MenuItem<Label, Shortcut>
impl<Label, Shortcut> UnwindSafe for MenuItem<Label, Shortcut>where
Label: UnwindSafe,
Shortcut: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)