Tray

Tray item displayed in system notification area.

Modulerequire("gui")
TypeClass

Platform limitations:

Class methods

createWithImage(icon)

Create a tray item with icon.

Parameters

Return

Tray

createWithTitle(title) macOS

Create a tray item with only title.

Parameters

Return

Tray

Methods

remove()

Remove the tray item.

getBounds() macOS Windows

Return the position and size of the tray item.

Return

RectF

setTitle(title) macOS Linux

Set title to be displayed aside item's icon.

Parameters

setImage(icon)

Set the icon of tray item.

Parameters

setPressedImage(image) macOS

Set the image to show when tray item is pressed.

Parameters

setMenu(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

getMenu()

Return the menu attached.

Return

Menu

Events

onClick(self) macOS Windows

Emitted when the tray item is clicked.

Parameters

Preventable

No.