Struct druid_shell::Menu[][src]

pub struct Menu(_);
Expand description

A menu object.

This may be a window menu, an application menu (macOS) or a context (right-click) menu.

Configuring menus

Currently, a menu and its items cannot be changed once created. If you need to change anything about a menu (for instance, disabling or selecting items) you need to create a new menu with the desired properties.

Implementations

Create a new empty window or application menu.

Create a new empty context menu.

Some platforms distinguish between these types of menus, and some do not.

Add the provided Menu as a submenu of self, with the provided title.

Add an item to this menu.

The id should uniquely identify this item. If the user selects this item, the responsible WindowHandler’s command() method will be called with this id. If the enabled argument is false, the menu item will be grayed out; the hotkey will also be disabled. If the selected argument is true, the menu will have a checkmark or platform appropriate equivalent indicating that it is currently selected. The key argument is an optional HotKey that will be registered with the system.

Add a seperator to the menu.

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

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more