Struct workflow_nw::menu::MenuItemBuilder
source · pub struct MenuItemBuilder {
pub options: Options,
pub callback: Option<Callback<CallbackClosure<JsValue>>>,
}Expand description
MenuItem Builder
For usage example please refer to Examples
Fields§
§options: Options§callback: Option<Callback<CallbackClosure<JsValue>>>Implementations§
source§impl MenuItemBuilder
impl MenuItemBuilder
pub fn new() -> Self
sourcepub fn set_type(self, t: MenuItemType) -> Self
pub fn set_type(self, t: MenuItemType) -> Self
Type of MenuItem
sourcepub fn callback<F>(self, callback: F) -> Self
pub fn callback<F>(self, callback: F) -> Self
The callback function when item is triggered by mouse click or keyboard shortcut
sourcepub fn enabled(self, enabled: bool) -> Self
pub fn enabled(self, enabled: bool) -> Self
Whether the item is enabled or disabled. It’s set to true by default.
sourcepub fn checked(self, checked: bool) -> Self
pub fn checked(self, checked: bool) -> Self
Whether the checkbox is checked or not. It’s set to false by default.
A submenu
Create submenu from menu items
pub fn build(self) -> Result<MenuItem>
pub fn finalize( self ) -> Result<(MenuItem, Option<Callback<CallbackClosure<JsValue>>>)>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for MenuItemBuilder
impl !Send for MenuItemBuilder
impl !Sync for MenuItemBuilder
impl Unpin for MenuItemBuilder
impl UnwindSafe for MenuItemBuilder
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