TSdlTray
A toplevel system tray object.
Definition
Unit: Neslib.Sdl3.Additional
Properties
Name | Description |
---|---|
Menu | The previously created tray menu. |
Constructors
Name | Description |
---|---|
Create | Create an icon to be placed in the operating system's tray, or equivalent. |
Operators
Name | Description |
---|---|
Equal(TSdlTray, TSdlTray) | Used to compare against another TSdlTray. |
Equal(TSdlTray, Pointer) | Used to compare against nil . |
Implicit | Used to set the value to nil . |
NotEqual(TSdlTray, TSdlTray) | Used to compare against another TSdlTray. |
NotEqual(TSdlTray, Pointer) | Used to compare against nil . |
Methods
Name | Description |
---|---|
CreateMenu | Create a menu for the system tray. |
Free | Destroys the tray object. |
SetIcon | Updates the system tray icon's icon. |
SetTooltip | Updates the system tray icon's tooltip. |
Update | Update the trays. |
Property Descriptions
Menu
The previously created tray menu.
You should have called CreateMenu. This property allows you to fetch it again later.
This property does the same thing as TSdlTrayEntry.Submenu, except that it works on a TSdlTray instead of a TSdlTrayEntry.
A menu does not need to be destroyed; it will be destroyed with the tray.
property Menu: TSdlTrayMenu read GetMenu
Type: TSdlTrayMenu
See Also
Remarks
This property should be used on the thread that created the tray.
Constructor Descriptions
Create
Create an icon to be placed in the operating system's tray, or equivalent.
Many platforms advise not using a system tray unless persistence is a necessary feature. Avoid needlessly creating a tray icon, as the user may feel like it clutters their interface.
Using tray icons require the video subsystem.
constructor Create(const AIcon: TSdlSurface; const ATooltip: String = '')
Parameters
AIcon
: TSdlSurface
: A surface to be used as icon. May be nil.
ATooltip
: String = ''
: (Optional) tooltip to be displayed when the mouse hovers the icon. Not supported on all platforms.
See Also
Remarks
This constructor should only be called on the main thread.
Operator Descriptions
Equal(TSdlTray, TSdlTray)
Used to compare against another TSdlTray.
class operator Equal(const ALeft, ARight: TSdlTray): Boolean; inline; static
Parameters
ALeft
: TSdlTray
ARight
: TSdlTray
Returns
Boolean
Equal(TSdlTray, Pointer)
Used to compare against nil
.
class operator Equal(const ALeft: TSdlTray; const ARight: Pointer): Boolean; inline; static
Parameters
ALeft
: TSdlTray
ARight
: Pointer
Returns
Boolean
Implicit(Pointer)
Used to set the value to nil
.
class operator Implicit(const AValue: Pointer): TSdlTray; inline; static
Parameters
AValue
: Pointer
Returns
NotEqual(TSdlTray, TSdlTray)
Used to compare against another TSdlTray.
class operator NotEqual(const ALeft, ARight: TSdlTray): Boolean; inline; static
Parameters
ALeft
: TSdlTray
ARight
: TSdlTray
Returns
Boolean
NotEqual(TSdlTray, Pointer)
Used to compare against nil
.
class operator NotEqual(const ALeft: TSdlTray; const ARight: Pointer): Boolean; inline; static
Parameters
ALeft
: TSdlTray
ARight
: Pointer
Returns
Boolean
Method Descriptions
CreateMenu
Create a menu for the system tray.
This should be called at most once per tray icon.
This function does the same thing as TSdlTrayEntry.CreateSubMenu, except that it works on a TSdlTray instead of a TSdlTrayEntry.
A menu does not need to be destroyed; it will be destroyed with the tray.
function CreateMenu: TSdlTrayMenu; inline
Returns
TSdlTrayMenu
: The newly created menu.
See Also
Remarks
This method should be called on the thread that created the tray.
Free
Destroys the tray object.
This also destroys all associated menus and entries.
procedure Free
Remarks
This method should be called on the thread that created the tray.
SetIcon(TSdlSurface)
Updates the system tray icon's icon.
procedure SetIcon(const AIcon: TSdlSurface); inline
Parameters
AIcon
: TSdlSurface
: The new icon. May be nil.
Remarks
This method should be called on the thread that created the tray.
SetTooltip(String)
Updates the system tray icon's tooltip.
procedure SetTooltip(const ATooltip: String); inline
Parameters
ATooltip
: String
: The new tooltip.
Remarks
This method should be called on the thread that created the tray.
Update
Update the trays.
This is called automatically by the event loop and is only needed if you're using trays but aren't handling SDL events.
class procedure Update; inline; static
Remarks
This method should only be called on the main thread.