Tray

Tray item displayed in system notification area.

Header#include "nativeui/tray.h"
Namespacenamespace nu
Typeclass (RefCounted)

Platform limitations:

Constructors

Tray(Image* icon)

Create a tray item with icon.

Parameters

Tray(const std::string& title) macOS

Create a tray item with only title.

Parameters

Methods

void SetTitle(const std::string& title) macOS linux

Set title to be displayed aside item's icon.

Parameters

void SetImage(Image* icon)

Set the icon of tray item.

Parameters

void SetMenu(Menu* menu)

Set the menu attached with the tray item.

On most platforms the menu will show when clicking on the icon, while on Windows the menu will only show when when right-clicking on the icon.

Parameters

Menu* GetMenu() const

Return the menu attached.

Return

Menu*

Events

void on_click(Button* self) Windows

Emitted when the tray item is clicked.

Parameters

Preventable

No.