# NativeMenuItem

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/struct-nativemenuitem/

**struct** · [`ferroui-controls`](/docs/0.5.0/api/ferroui-controls/) · v0.5.0

```rust
struct NativeMenuItem
```

An item of a [`NativeMenu`](/docs/0.5.0/api/ferroui-controls/struct-nativemenu/).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L19)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`menu_property`](#function-menu_property)
- [`icon_property`](#function-icon_property)
- [`header_property`](#function-header_property)
- [`tool_tip_property`](#function-tool_tip_property)
- [`gesture_property`](#function-gesture_property)
- [`is_checked_property`](#function-is_checked_property)
- [`toggle_type_property`](#function-toggle_type_property)
- [`command_property`](#function-command_property)
- [`command_parameter_property`](#function-command_parameter_property)
- [`is_enabled_property`](#function-is_enabled_property)
- [`is_visible_property`](#function-is_visible_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`with_header`](#function-with_header)
- [`menu`](#function-menu)
- [`set_menu`](#function-set_menu)
- [`icon`](#function-icon)
- [`set_icon`](#function-set_icon)
- [`header`](#function-header)
- [`set_header`](#function-set_header)
- [`tool_tip`](#function-tool_tip)
- [`set_tool_tip`](#function-set_tool_tip)
- [`gesture`](#function-gesture)
- [`set_gesture`](#function-set_gesture)
- [`is_checked`](#function-is_checked)
- [`set_is_checked`](#function-set_is_checked)
- [`toggle_type`](#function-toggle_type)
- [`set_toggle_type`](#function-set_toggle_type)
- [`is_enabled`](#function-is_enabled)
- [`set_is_enabled`](#function-set_is_enabled)
- [`is_visible`](#function-is_visible)
- [`set_is_visible`](#function-set_is_visible)
- [`has_click_handlers`](#function-has_click_handlers)
- [`command`](#function-command)
- [`set_command`](#function-set_command)
- [`command_parameter`](#function-command_parameter)
- [`set_command_parameter`](#function-set_command_parameter)
- [`click`](#function-click)
- [`to_exporter_events_bridge`](#function-to_exporter_events_bridge)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L28)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<NativeMenuItem>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L28)

<a id="function-menu_property"></a>

### menu_property

```rust
fn menu_property() -> &'static StyledProperty<Option<Ref<NativeMenu>>>
```

Defines the `Menu` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L79)

<a id="function-icon_property"></a>

### icon_property

```rust
fn icon_property() -> &'static StyledProperty<Option<Rc<dyn IBitmap>>>
```

Defines the `Icon` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L79)

<a id="function-header_property"></a>

### header_property

```rust
fn header_property() -> &'static StyledProperty<Option<String>>
```

Defines the `Header` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L79)

<a id="function-tool_tip_property"></a>

### tool_tip_property

```rust
fn tool_tip_property() -> &'static StyledProperty<Option<String>>
```

Defines the `ToolTip` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L79)

<a id="function-gesture_property"></a>

### gesture_property

```rust
fn gesture_property() -> &'static StyledProperty<Option<KeyGesture>>
```

Defines the `Gesture` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L79)

<a id="function-is_checked_property"></a>

### is_checked_property

```rust
fn is_checked_property() -> &'static StyledProperty<bool>
```

Defines the `IsChecked` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L79)

<a id="function-toggle_type_property"></a>

### toggle_type_property

```rust
fn toggle_type_property() -> &'static StyledProperty<MenuItemToggleType>
```

Defines the `ToggleType` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L79)

<a id="function-command_property"></a>

### command_property

```rust
fn command_property() -> &'static StyledProperty<Option<Rc<dyn ICommand>>>
```

Defines the `Command` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L79)

<a id="function-command_parameter_property"></a>

### command_parameter_property

```rust
fn command_parameter_property() -> &'static StyledProperty<Option<BoxedValue>>
```

Defines the `CommandParameter` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L79)

<a id="function-is_enabled_property"></a>

### is_enabled_property

```rust
fn is_enabled_property() -> &'static StyledProperty<bool>
```

Defines the `IsEnabled` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L79)

<a id="function-is_visible_property"></a>

### is_visible_property

```rust
fn is_visible_property() -> &'static StyledProperty<bool>
```

Defines the `IsVisible` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L79)

<a id="function-construct"></a>

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L144)

<a id="function-new"></a>

### new

```rust
fn new() -> Ref<Self>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L152)

<a id="function-with_header"></a>

### with_header

```rust
fn with_header(header: &str) -> Ref<Self>
```

Creates an item with the given header.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L157)

<a id="function-menu"></a>

### menu

```rust
fn menu(self: &Self) -> Option<Ref<NativeMenu>>
```

The submenu of the item.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L164)

<a id="function-set_menu"></a>

### set_menu

```rust
fn set_menu(self: &Self, value: Option<Ref<NativeMenu>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L168)

<a id="function-icon"></a>

### icon

```rust
fn icon(self: &Self) -> Option<Rc<dyn IBitmap>>
```

The icon that appears in the item.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L183)

<a id="function-set_icon"></a>

### set_icon

```rust
fn set_icon(self: &Self, value: Option<Rc<dyn IBitmap>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L187)

<a id="function-header"></a>

### header

```rust
fn header(self: &Self) -> Option<String>
```

The header of the item.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L192)

<a id="function-set_header"></a>

### set_header

```rust
fn set_header(self: &Self, value: Option<String>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L196)

<a id="function-tool_tip"></a>

### tool_tip

```rust
fn tool_tip(self: &Self) -> Option<String>
```

Gets the tooltip associated with the menu item. This may not be
supported by the native menu provider, but will be passed on to the
non-native fallback menu item if used.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L203)

<a id="function-set_tool_tip"></a>

### set_tool_tip

```rust
fn set_tool_tip(self: &Self, value: Option<String>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L207)

<a id="function-gesture"></a>

### gesture

```rust
fn gesture(self: &Self) -> Option<KeyGesture>
```

The input gesture that will be displayed in the item.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L212)

<a id="function-set_gesture"></a>

### set_gesture

```rust
fn set_gesture(self: &Self, value: Option<KeyGesture>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L216)

<a id="function-is_checked"></a>

### is_checked

```rust
fn is_checked(self: &Self) -> bool
```

Whether the item is checked.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L221)

<a id="function-set_is_checked"></a>

### set_is_checked

```rust
fn set_is_checked(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L225)

<a id="function-toggle_type"></a>

### toggle_type

```rust
fn toggle_type(self: &Self) -> MenuItemToggleType
```

How the item reacts to clicks.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L230)

<a id="function-set_toggle_type"></a>

### set_toggle_type

```rust
fn set_toggle_type(self: &Self, value: MenuItemToggleType)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L234)

<a id="function-is_enabled"></a>

### is_enabled

```rust
fn is_enabled(self: &Self) -> bool
```

Whether the item is enabled.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L239)

<a id="function-set_is_enabled"></a>

### set_is_enabled

```rust
fn set_is_enabled(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L243)

<a id="function-is_visible"></a>

### is_visible

```rust
fn is_visible(self: &Self) -> bool
```

Gets a value indicating whether this menu item is visible.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L248)

<a id="function-set_is_visible"></a>

### set_is_visible

```rust
fn set_is_visible(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L252)

<a id="function-has_click_handlers"></a>

### has_click_handlers

```rust
fn has_click_handlers(self: &Self) -> bool
```

Whether the `click` event has handlers.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L266)

<a id="function-command"></a>

### command

```rust
fn command(self: &Self) -> Option<Rc<dyn ICommand>>
```

The command to invoke when the item is clicked.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L271)

<a id="function-set_command"></a>

### set_command

```rust
fn set_command(self: &Self, value: Option<Rc<dyn ICommand>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L275)

<a id="function-command_parameter"></a>

### command_parameter

```rust
fn command_parameter(self: &Self) -> Option<BoxedValue>
```

The parameter to pass to the command.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L280)

<a id="function-set_command_parameter"></a>

### set_command_parameter

```rust
fn set_command_parameter(self: &Self, value: Option<BoxedValue>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L284)

<a id="function-click"></a>

### click

```rust
fn click(self: &Self, handler: impl Fn(&NativeMenuItem) -> () + 'static) -> Subscription
```

Occurs when a `NativeMenuItem` is clicked.

Dropping the returned guard removes the handler; `Subscription::detach` keeps it for the
life of the item.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L292)

<a id="function-to_exporter_events_bridge"></a>

### to_exporter_events_bridge

```rust
fn to_exporter_events_bridge(self: &Self) -> Rc<dyn INativeMenuItemExporterEventsImplBridge>
```

The item viewed as the contract through which the platform
exporter of the menu raises the events of the item.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/native_menu_item.rs#L304)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<NativeMenuItem>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
