Available on crate feature
appkit
only.Expand description
A struct that represents an NSMenu
. It takes ownership of items, and handles instrumenting
them throughout the application lifecycle.
Tuple Fields
0: Id<Object>
Implementations
sourceimpl Menu
impl Menu
sourcepub fn new(title: &str, items: Vec<MenuItem>) -> Self
pub fn new(title: &str, items: Vec<MenuItem>) -> Self
Creates a new Menu
with the given title, and uses the passed items as submenu items.
This method effectively does three things:
- Consumes the MenuItem Vec, and pulls out handlers we need to cache
- Configures the menu items appropriately, and wires them up
- Drops the values we no longer need, and returns only what’s necessary to get the menu functioning.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Menu
impl Send for Menu
impl Sync for Menu
impl Unpin for Menu
impl UnwindSafe for Menu
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more