pub struct CheckMenuItem<R: Runtime>(/* private fields */);Available on
desktop only.Expand description
Implementations§
Source§impl<R: Runtime> CheckMenuItem<R>
impl<R: Runtime> CheckMenuItem<R>
Sourcepub fn new<M, T, A>(
manager: &M,
text: T,
enabled: bool,
checked: bool,
accelerator: Option<A>,
) -> Result<Self>
pub fn new<M, T, A>( manager: &M, text: T, enabled: bool, checked: bool, accelerator: Option<A>, ) -> Result<Self>
Create a new menu item.
textcould optionally contain an&before a character to assign this character as the mnemonic for this menu item. To display a&without assigning a mnemenonic, use&&.
Sourcepub fn with_id<M, I, T, A>(
manager: &M,
id: I,
text: T,
enabled: bool,
checked: bool,
accelerator: Option<A>,
) -> Result<Self>
pub fn with_id<M, I, T, A>( manager: &M, id: I, text: T, enabled: bool, checked: bool, accelerator: Option<A>, ) -> Result<Self>
Create a new menu item with the specified id.
textcould optionally contain an&before a character to assign this character as the mnemonic for this menu item. To display a&without assigning a mnemenonic, use&&.
Sourcepub fn app_handle(&self) -> &AppHandle<R>
pub fn app_handle(&self) -> &AppHandle<R>
The application handle associated with this type.
Sourcepub fn set_text<S: AsRef<str>>(&self, text: S) -> Result<()>
pub fn set_text<S: AsRef<str>>(&self, text: S) -> Result<()>
Set the text for this menu item. text could optionally contain
an & before a character to assign this character as the mnemonic
for this menu item. To display a & without assigning a mnemenonic, use &&.
Sourcepub fn is_enabled(&self) -> Result<bool>
pub fn is_enabled(&self) -> Result<bool>
Get whether this menu item is enabled or not.
Sourcepub fn set_enabled(&self, enabled: bool) -> Result<()>
pub fn set_enabled(&self, enabled: bool) -> Result<()>
Enable or disable this menu item.
Sourcepub fn set_accelerator<S: AsRef<str>>(
&self,
accelerator: Option<S>,
) -> Result<()>
pub fn set_accelerator<S: AsRef<str>>( &self, accelerator: Option<S>, ) -> Result<()>
Set this menu item accelerator.
Sourcepub fn is_checked(&self) -> Result<bool>
pub fn is_checked(&self) -> Result<bool>
Get whether this check menu item is checked or not.
Sourcepub fn set_checked(&self, checked: bool) -> Result<()>
pub fn set_checked(&self, checked: bool) -> Result<()>
Check or Uncheck this check menu item.
Trait Implementations§
Source§impl<R: Runtime> Clone for CheckMenuItem<R>
impl<R: Runtime> Clone for CheckMenuItem<R>
Source§impl<R: Runtime> IsMenuItem<R> for CheckMenuItem<R>
impl<R: Runtime> IsMenuItem<R> for CheckMenuItem<R>
Auto Trait Implementations§
impl<R> Freeze for CheckMenuItem<R>
impl<R> !RefUnwindSafe for CheckMenuItem<R>
impl<R> Send for CheckMenuItem<R>
impl<R> Sync for CheckMenuItem<R>
impl<R> Unpin for CheckMenuItem<R>
impl<R> UnsafeUnpin for CheckMenuItem<R>
impl<R> !UnwindSafe for CheckMenuItem<R>
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