pub struct Menu(pub Id<Object>);
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

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.

Given a set of MenuItems, merges them into an existing Menu (e.g, for a context menu on a view).

Convenience method for the bare-minimum NSMenu structure that “just works” for all applications, as expected.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.