on

fun on(event: TrayEvent.BALLOON_CLICK, listener: Function<Unit>)(source)

Emitted when the tray balloon is clicked.


Emitted when the tray balloon is closed because of timeout or user manually closes it.


fun on(event: TrayEvent.BALLOON_SHOW, listener: Function<Unit>)(source)

Emitted when the tray balloon shows.


fun on(event: TrayEvent.CLICK, listener: (event: KeyboardEvent, bounds: Rectangle, position: Point) -> Unit)(source)

Emitted when the tray icon is clicked.

Note that on Linux this event is emitted when the tray icon receives an activation, which might not necessarily be left mouse click.


fun on(event: TrayEvent.DOUBLE_CLICK, listener: (event: KeyboardEvent, bounds: Rectangle) -> Unit)(source)

Emitted when the tray icon is double clicked.


fun on(event: TrayEvent.DRAG_END, listener: Function<Unit>)(source)

Emitted when a drag operation ends on the tray or ends at another location.


fun on(event: TrayEvent.DRAG_ENTER, listener: Function<Unit>)(source)

Emitted when a drag operation enters the tray icon.


fun on(event: TrayEvent.DRAG_LEAVE, listener: Function<Unit>)(source)

Emitted when a drag operation exits the tray icon.


fun on(event: TrayEvent.DROP, listener: Function<Unit>)(source)

Emitted when any dragged items are dropped on the tray icon.


fun on(event: TrayEvent.DROP_FILES, listener: (event: Event<*>, ReadonlyArray<String>) -> Unit)(source)

Emitted when dragged files are dropped in the tray icon.


fun on(event: TrayEvent.DROP_TEXT, listener: (event: Event<*>, text: String) -> Unit)(source)

Emitted when dragged text is dropped in the tray icon.


fun on(event: TrayEvent.MIDDLE_CLICK, listener: (event: KeyboardEvent, bounds: Rectangle) -> Unit)(source)

Emitted when the tray icon is middle clicked.


fun on(event: TrayEvent.MOUSE_DOWN, listener: (event: KeyboardEvent, position: Point) -> Unit)(source)

Emitted when the mouse clicks the tray icon.


fun on(event: TrayEvent.MOUSE_ENTER, listener: (event: KeyboardEvent, position: Point) -> Unit)(source)

Emitted when the mouse enters the tray icon.


fun on(event: TrayEvent.MOUSE_LEAVE, listener: (event: KeyboardEvent, position: Point) -> Unit)(source)

Emitted when the mouse exits the tray icon.


fun on(event: TrayEvent.MOUSE_MOVE, listener: (event: KeyboardEvent, position: Point) -> Unit)(source)

Emitted when the mouse moves in the tray icon.


fun on(event: TrayEvent.MOUSE_UP, listener: (event: KeyboardEvent, position: Point) -> Unit)(source)

Emitted when the mouse is released from clicking the tray icon.

Note: This will not be emitted if you have set a context menu for your Tray using tray.setContextMenu, as a result of macOS-level constraints.


fun on(event: TrayEvent.RIGHT_CLICK, listener: (event: KeyboardEvent, bounds: Rectangle) -> Unit)(source)

Emitted when the tray icon is right clicked.