pub struct NullCommand { /* private fields */ }
Implementations§
Source§impl NullCommand
impl NullCommand
Sourcepub fn action<F: Fn()>(self, func: F) -> Command2<F>
pub fn action<F: Fn()>(self, func: F) -> Command2<F>
Adds an action to the menu command.
Examples found in repository?
examples/menu.rs (line 21)
6fn main() {
7 rui(hstack((
8 circle()
9 .color(RED_HIGHLIGHT)
10 .padding(Auto)
11 .command("File:New", Some(HotKey::KeyN), |_| println!("new")),
12 rectangle()
13 .corner_radius(5.0)
14 .color(AZURE_HIGHLIGHT)
15 .padding(Auto)
16 .command("Edit:Two", None, |_| println!("two"))
17 .command("Edit:Three", None, |_| println!("three"))
18 .command("Custom:Submenu:One", None, |_| println!("submenu one"))
19 .command("Custom:Submenu:Two", None, |_| println!("submenu two"))
20 .command_group((command("Custom 2:Four")
21 .action(|| println!("four"))
22 .hotkey(HotKey::KeyF),)),
23 )));
24}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NullCommand
impl RefUnwindSafe for NullCommand
impl Send for NullCommand
impl Sync for NullCommand
impl Unpin for NullCommand
impl UnwindSafe for NullCommand
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