Tray Type
⚠ Process Availability: Main ✔ | Renderer ❌ | Utility ❌ | Exported ✔### Class: Tray> Add icons and context menus to the system's notification area.Process: MainTray is an EventEmitter.const { app, Menu, Tray } = require('electron')let tray = nullapp.whenReady().then(() => { tray = new Tray('/path/to/my/icon') const contextMenu = Menu.buildFromTemplate([ { label: 'Item1', type: 'radio' }, { label: 'Item2', type: 'radio' }, { label: 'Item3', type: 'radio', checked: true }, { label: 'Item4', type: 'radio' } ]) tray.setToolTip('This is my application.') tray.setContextMenu(contextMenu)})> [!TIP] See also: A detailed guide about how to implement Tray menus.> [!WARNING] Electron's built-in classes cannot be subclassed in user code. For more information, see the FAQ.Platform Considerations*Linux Tray icon uses StatusNotifierItem by default, when it is not available in user's desktop environment the GtkStatusIcon will be used instead. The click event is emitted when the tray icon receives activation from user, however the StatusNotifierItem spec does not specify which action would cause an activation, for some environments it is left mouse click, but for some it might be double left mouse click. In order for changes made to individual MenuItems to take effect, you have to call setContextMenu again. For example:const { app, Menu, Tray } = require('electron')let appIcon = nullapp.whenReady().then(() => { appIcon = new Tray('/path/to/my/icon') const contextMenu = Menu.buildFromTemplate([ { label: 'Item1', type: 'radio' }, { label: 'Item2', type: 'radio' } ]) // Make a change to the context menu contextMenu.items[1].checked = false // Call this again for Linux because we modified the context menu appIcon.setContextMenu(contextMenu)})MacOS* Icons passed to the Tray constructor should be Template Images.* To make sure your icon isn't grainy on retina monitors, be sure your @2x image is 144dpi.* If you are bundling your application (e.g., with webpack for development), be sure that the file names are not being mangled or hashed. The filename needs to end in Template, and the @2x image needs to have the same filename as the standard image, or MacOS will not magically invert your image's colors or use the high density image.* 16x16 (72dpi) and 32x32@2x (144dpi) work well for most icons.Windows* It is recommended to use ICO icons to get best visual effects.
Constructors
| Constructor |
Description
|
Full Usage:
Tray(image, ?guid)
Parameters:
U2<NativeImage, string>
-
?guid : string
-
A unique string used to identify the tray icon. Must adhere to UUID format.
Returns: Tray
|
|
Instance members
| Instance member |
Description
|
Full Usage:
this.closeContextMenu ()
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Closes an open context menu, as set by tray.setContextMenu(). |
Full Usage:
this.destroy ()
Modifiers: inline |
Destroys the tray icon immediately. |
Full Usage:
this.displayBalloon (?icon, ?iconType, ?title, ?content, ?largeIcon, ?noSound, ?respectQuietTime)
Parameters:
U2<NativeImage, string>
?iconType : IconType
?title : string
?content : string
?largeIcon : bool
?noSound : bool
?respectQuietTime : bool
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Displays a tray balloon.
|
Full Usage:
this.focus ()
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Returns focus to the taskbar notification area. Notification area icons should use this message when they have completed their UI operation. For example, if the icon displays a shortcut menu, but the user presses ESC to cancel it, use tray.focus() to return focus to the notification area. |
|
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ The bounds of this tray icon as Object.
|
|
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ The GUID used to uniquely identify the tray icon and allow it to retain its position between relaunches, or null if none is set.
|
Full Usage:
this.getIgnoreDoubleClickEvents ()
Returns: bool
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Whether double click events will be ignored.
|
Full Usage:
this.getTitle ()
Returns: string
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ the title displayed next to the tray icon in the status bar
|
Full Usage:
this.isDestroyed ()
Returns: bool
Modifiers: inline |
Whether the tray icon is destroyed.
|
Full Usage:
this.offBalloonClick handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Emitted when the tray balloon is clicked.
|
Full Usage:
this.offBalloonClosed handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Emitted when the tray balloon is closed because of timeout or user manually closes it.
|
Full Usage:
this.offBalloonShow handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Emitted when the tray balloon shows.
|
|
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.
|
Full Usage:
this.offClick handler
Parameters:
KeyboardEvent -> Rectangle -> Point -> unit
Modifiers: inline |
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.
|
Full Usage:
this.offDoubleClick handler
Parameters:
IOnDoubleClick -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the tray icon is double clicked.
|
Full Usage:
this.offDoubleClick handler
Parameters:
KeyboardEvent -> Rectangle -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the tray icon is double clicked.
|
Full Usage:
this.offDragEnd handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when a drag operation ends on the tray or ends at another location.
|
Full Usage:
this.offDragEnter handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when a drag operation enters the tray icon.
|
Full Usage:
this.offDragLeave handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when a drag operation exits the tray icon.
|
Full Usage:
this.offDrop handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when any dragged items are dropped on the tray icon.
|
|
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when dragged files are dropped in the tray icon.
|
Full Usage:
this.offDropFiles handler
Parameters:
Event -> string[] -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when dragged files are dropped in the tray icon.
|
|
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when dragged text is dropped in the tray icon.
|
Full Usage:
this.offDropText handler
Parameters:
Event -> string -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when dragged text is dropped in the tray icon.
|
Full Usage:
this.offMiddleClick handler
Parameters:
IOnMiddleClick -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Emitted when the tray icon is middle clicked.
|
Full Usage:
this.offMiddleClick handler
Parameters:
KeyboardEvent -> Rectangle -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Emitted when the tray icon is middle clicked.
|
|
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse clicks the tray icon.
|
Full Usage:
this.offMouseDown handler
Parameters:
KeyboardEvent -> Point -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse clicks the tray icon.
|
Full Usage:
this.offMouseEnter handler
Parameters:
IOnMouseEnter -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse enters the tray icon.
|
Full Usage:
this.offMouseEnter handler
Parameters:
KeyboardEvent -> Point -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse enters the tray icon.
|
Full Usage:
this.offMouseLeave handler
Parameters:
IOnMouseLeave -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse exits the tray icon.
|
Full Usage:
this.offMouseLeave handler
Parameters:
KeyboardEvent -> Point -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse exits the tray icon.
|
|
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse moves in the tray icon.
|
Full Usage:
this.offMouseMove handler
Parameters:
KeyboardEvent -> Point -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse moves in the tray icon.
|
|
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ 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.
|
Full Usage:
this.offMouseUp handler
Parameters:
KeyboardEvent -> Point -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ 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.
|
Full Usage:
this.offRightClick handler
Parameters:
IOnRightClick -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the tray icon is right clicked.
|
Full Usage:
this.offRightClick handler
Parameters:
KeyboardEvent -> Rectangle -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the tray icon is right clicked.
|
Full Usage:
this.onBalloonClick handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Emitted when the tray balloon is clicked.
|
Full Usage:
this.onBalloonClosed handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Emitted when the tray balloon is closed because of timeout or user manually closes it.
|
Full Usage:
this.onBalloonShow handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Emitted when the tray balloon shows.
|
|
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.
|
Full Usage:
this.onClick handler
Parameters:
KeyboardEvent -> Rectangle -> Point -> unit
Modifiers: inline |
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.
|
Full Usage:
this.onDoubleClick handler
Parameters:
IOnDoubleClick -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the tray icon is double clicked.
|
Full Usage:
this.onDoubleClick handler
Parameters:
KeyboardEvent -> Rectangle -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the tray icon is double clicked.
|
Full Usage:
this.onDragEnd handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when a drag operation ends on the tray or ends at another location.
|
Full Usage:
this.onDragEnter handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when a drag operation enters the tray icon.
|
Full Usage:
this.onDragLeave handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when a drag operation exits the tray icon.
|
Full Usage:
this.onDrop handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when any dragged items are dropped on the tray icon.
|
|
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when dragged files are dropped in the tray icon.
|
Full Usage:
this.onDropFiles handler
Parameters:
Event -> string[] -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when dragged files are dropped in the tray icon.
|
|
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when dragged text is dropped in the tray icon.
|
|
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when dragged text is dropped in the tray icon.
|
Full Usage:
this.onMiddleClick handler
Parameters:
IOnMiddleClick -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Emitted when the tray icon is middle clicked.
|
Full Usage:
this.onMiddleClick handler
Parameters:
KeyboardEvent -> Rectangle -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Emitted when the tray icon is middle clicked.
|
|
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse clicks the tray icon.
|
Full Usage:
this.onMouseDown handler
Parameters:
KeyboardEvent -> Point -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse clicks the tray icon.
|
|
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse enters the tray icon.
|
Full Usage:
this.onMouseEnter handler
Parameters:
KeyboardEvent -> Point -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse enters the tray icon.
|
|
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse exits the tray icon.
|
Full Usage:
this.onMouseLeave handler
Parameters:
KeyboardEvent -> Point -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse exits the tray icon.
|
|
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse moves in the tray icon.
|
Full Usage:
this.onMouseMove handler
Parameters:
KeyboardEvent -> Point -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse moves in the tray icon.
|
|
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ 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.
|
Full Usage:
this.onMouseUp handler
Parameters:
KeyboardEvent -> Point -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ 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.
|
|
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the tray icon is right clicked.
|
Full Usage:
this.onRightClick handler
Parameters:
KeyboardEvent -> Rectangle -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the tray icon is right clicked.
|
Full Usage:
this.onceBalloonClick handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Emitted when the tray balloon is clicked.
|
Full Usage:
this.onceBalloonClosed handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Emitted when the tray balloon is closed because of timeout or user manually closes it.
|
Full Usage:
this.onceBalloonShow handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Emitted when the tray balloon shows.
|
|
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.
|
Full Usage:
this.onceClick handler
Parameters:
KeyboardEvent -> Rectangle -> Point -> unit
Modifiers: inline |
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.
|
Full Usage:
this.onceDoubleClick handler
Parameters:
IOnDoubleClick -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the tray icon is double clicked.
|
Full Usage:
this.onceDoubleClick handler
Parameters:
KeyboardEvent -> Rectangle -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the tray icon is double clicked.
|
Full Usage:
this.onceDragEnd handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when a drag operation ends on the tray or ends at another location.
|
Full Usage:
this.onceDragEnter handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when a drag operation enters the tray icon.
|
Full Usage:
this.onceDragLeave handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when a drag operation exits the tray icon.
|
Full Usage:
this.onceDrop handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when any dragged items are dropped on the tray icon.
|
|
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when dragged files are dropped in the tray icon.
|
Full Usage:
this.onceDropFiles handler
Parameters:
Event -> string[] -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when dragged files are dropped in the tray icon.
|
|
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when dragged text is dropped in the tray icon.
|
Full Usage:
this.onceDropText handler
Parameters:
Event -> string -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when dragged text is dropped in the tray icon.
|
Full Usage:
this.onceMiddleClick handler
Parameters:
IOnMiddleClick -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Emitted when the tray icon is middle clicked.
|
Full Usage:
this.onceMiddleClick handler
Parameters:
KeyboardEvent -> Rectangle -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Emitted when the tray icon is middle clicked.
|
|
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse clicks the tray icon.
|
Full Usage:
this.onceMouseDown handler
Parameters:
KeyboardEvent -> Point -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse clicks the tray icon.
|
Full Usage:
this.onceMouseEnter handler
Parameters:
IOnMouseEnter -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse enters the tray icon.
|
Full Usage:
this.onceMouseEnter handler
Parameters:
KeyboardEvent -> Point -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse enters the tray icon.
|
Full Usage:
this.onceMouseLeave handler
Parameters:
IOnMouseLeave -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse exits the tray icon.
|
Full Usage:
this.onceMouseLeave handler
Parameters:
KeyboardEvent -> Point -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse exits the tray icon.
|
|
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse moves in the tray icon.
|
Full Usage:
this.onceMouseMove handler
Parameters:
KeyboardEvent -> Point -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the mouse moves in the tray icon.
|
|
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ 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.
|
Full Usage:
this.onceMouseUp handler
Parameters:
KeyboardEvent -> Point -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ 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.
|
Full Usage:
this.onceRightClick handler
Parameters:
IOnRightClick -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the tray icon is right clicked.
|
Full Usage:
this.onceRightClick handler
Parameters:
KeyboardEvent -> Rectangle -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the tray icon is right clicked.
|
|
|
Full Usage:
this.removeBalloon ()
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ❌ | MAS ❌ Removes a tray balloon. |
|
|
Full Usage:
this.setIgnoreDoubleClickEvents ignore
Parameters:
bool
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Sets the option to ignore double click events. Ignoring these events allows you to detect every individual click of the tray icon.This value is set to false by default.
|
|
Sets the image associated with this tray icon.
|
Full Usage:
this.setPressedImage image
Parameters:
U2<NativeImage, string>
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Sets the image associated with this tray icon when pressed on macOS.
|
Full Usage:
this.setTitle (title, ?fontType)
Parameters:
string
?fontType : FontType
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Sets the title displayed next to the tray icon in the status bar (Support ANSI colors).
|
Full Usage:
this.setToolTip toolTip
Parameters:
string
Modifiers: inline |
Sets the hover text for this tray icon. Setting the text to an empty string will remove the tooltip.
|
fable-electron-docs-api