# TrayIcon

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

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

```rust
struct TrayIcon
```

An icon in the notification area of the platform.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`command_property`](#function-command_property)
- [`command_parameter_property`](#function-command_parameter_property)
- [`icons_property`](#function-icons_property)
- [`menu_property`](#function-menu_property)
- [`icon_property`](#function-icon_property)
- [`tool_tip_text_property`](#function-tool_tip_text_property)
- [`is_visible_property`](#function-is_visible_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`clicked`](#function-clicked)
- [`set_icons`](#function-set_icons)
- [`get_icons`](#function-get_icons)
- [`command`](#function-command)
- [`set_command`](#function-set_command)
- [`command_parameter`](#function-command_parameter)
- [`set_command_parameter`](#function-set_command_parameter)
- [`menu`](#function-menu)
- [`set_menu`](#function-set_menu)
- [`icon`](#function-icon)
- [`set_icon`](#function-set_icon)
- [`tool_tip_text`](#function-tool_tip_text)
- [`set_tool_tip_text`](#function-set_tool_tip_text)
- [`is_visible`](#function-is_visible)
- [`set_is_visible`](#function-set_is_visible)
- [`dispose`](#function-dispose)
- [`to_disposable`](#function-to_disposable)

<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/tray_icon.rs#L65)

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

### to_ref

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

Returns a strong reference to this object.

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

<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/tray_icon.rs#L104)

<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/tray_icon.rs#L104)

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

### icons_property

```rust
fn icons_property() -> &'static AttachedProperty<Option<Rc<TrayIcons>>>
```

Defines the `Icons` attached property.

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

<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/tray_icon.rs#L104)

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

### icon_property

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

Defines the `Icon` property.

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

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

### tool_tip_text_property

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

Defines the `ToolTipText` property.

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

<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/tray_icon.rs#L104)

<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/tray_icon.rs#L175)

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

### new

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



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

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

### clicked

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

Raised when the TrayIcon is clicked.
Note, this is only supported on Win32 and some Linux DEs,
on OSX this event is not raised.

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

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

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

### set_icons

```rust
fn set_icons(o: &Application, tray_icons: Option<Rc<TrayIcons>>)
```

Sets the tray icons of the application.

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

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

### get_icons

```rust
fn get_icons(o: &Application) -> Option<Rc<TrayIcons>>
```

Gets the tray icons of the application.

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

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

### command

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

Gets the `Command` property of a TrayIcon.

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

<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/tray_icon.rs#L220)

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

### command_parameter

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

Gets the parameter to pass to the `Command` property of a
`TrayIcon`.

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

<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/tray_icon.rs#L230)

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

### menu

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

Gets the Menu of the TrayIcon.

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

<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/tray_icon.rs#L239)

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

### icon

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

Gets the icon of the TrayIcon.

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

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

### set_icon

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



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

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

### tool_tip_text

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

Gets the tooltip text of the TrayIcon.

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

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

### set_tool_tip_text

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



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

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

### is_visible

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

Gets the visibility of the TrayIcon.

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

<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/tray_icon.rs#L266)

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

### dispose

```rust
fn dispose(self: &Self)
```

Disposes the tray icon (removing it from the tray area).

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

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

### to_disposable

```rust
fn to_disposable(self: &Self) -> Rc<dyn IDisposable>
```

The tray icon viewed as a disposable.

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

## 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<TrayIcon>`](/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/).
