[][src]Struct imgui::MenuItem

#[must_use]
pub struct MenuItem<'a> { /* fields omitted */ }

Builder for a menu item.

Methods

impl<'a> MenuItem<'a>[src]

pub fn new(label: &ImStr) -> MenuItem[src]

Construct a new menu item builder.

pub fn shortcut(self, shortcut: &'a ImStr) -> Self[src]

Sets the menu item shortcut.

Shortcuts are displayed for convenience only and are not automatically handled.

pub fn selected(self, selected: bool) -> Self[src]

Sets the selected state of the menu item.

Default: false

pub fn enabled(self, enabled: bool) -> Self[src]

Enables/disables the menu item.

Default: enabled

pub fn build(self, _: &Ui) -> bool[src]

Builds the menu item.

Returns true if the menu item is activated.

impl<'a> MenuItem<'a>[src]

pub fn build_with_ref(self, ui: &Ui, selected: &mut bool) -> bool[src]

Builds the menu item using a mutable reference to selected state.

Trait Implementations

impl<'a> Clone for MenuItem<'a>[src]

impl<'a> Copy for MenuItem<'a>[src]

impl<'a> Debug for MenuItem<'a>[src]

Auto Trait Implementations

impl<'a> Unpin for MenuItem<'a>

impl<'a> Sync for MenuItem<'a>

impl<'a> Send for MenuItem<'a>

impl<'a> UnwindSafe for MenuItem<'a>

impl<'a> RefUnwindSafe for MenuItem<'a>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]