An opaque handle representing a toplevel system tray object.
More...
|
constexpr | Tray ()=default |
| Default ctor.
|
|
constexpr | Tray (const TrayRaw resource) |
| Constructs from TrayParam. More...
|
|
constexpr | Tray (const Tray &other)=delete |
| Copy constructor.
|
|
constexpr | Tray (Tray &&other) |
| Move constructor.
|
|
constexpr | Tray (const TrayRef &other)=delete |
|
constexpr | Tray (TrayRef &&other)=delete |
|
| Tray (SurfaceParam icon, StringParam tooltip) |
| Create an icon to be placed in the operating system's tray, or equivalent. More...
|
|
| ~Tray () |
| Destructor.
|
|
Tray & | operator= (Tray other) |
| Assignment operator.
|
|
constexpr TrayRaw | get () const |
| Retrieves underlying TrayRaw.
|
|
constexpr TrayRaw | release () |
| Retrieves underlying TrayRaw and clear this.
|
|
constexpr auto | operator<=> (const Tray &other) const =default |
| Comparison.
|
|
constexpr bool | operator== (std::nullptr_t _) const |
| Comparison.
|
|
constexpr | operator bool () const |
| Converts to bool.
|
|
constexpr | operator TrayParam () const |
| Converts to TrayParam.
|
|
void | Destroy () |
| Destroys a tray object. More...
|
|
void | SetIcon (SurfaceParam icon) |
| Updates the system tray icon's icon. More...
|
|
void | SetTooltip (StringParam tooltip) |
| Updates the system tray icon's tooltip. More...
|
|
TrayMenu | CreateMenu () |
| Create a menu for a system tray. More...
|
|
TrayMenu | GetMenu () const |
| Gets a previously created tray menu. More...
|
|
- Since
- This struct is available since SDL 3.2.0.
- Category:
- Resource
◆ Tray() [1/2]
constexpr SDL::Tray::Tray |
( |
const TrayRaw |
resource | ) |
|
|
inlineexplicitconstexpr |
- Parameters
-
resource | a TrayRaw to be wrapped. |
This assumes the ownership, call release() if you need to take back.
◆ Tray() [2/2]
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.
- Parameters
-
icon | a surface to be used as icon. May be nullptr. |
tooltip | a tooltip to be displayed when the mouse hovers the icon in UTF-8 encoding. Not supported on all platforms. May be nullptr. |
- Postcondition
- The newly created system tray icon.
- Thread safety:
- This function should only be called on the main thread.
- Since
- This function is available since SDL 3.2.0.
- See also
- Tray.CreateMenu
-
Tray.GetMenu
-
Tray.Destroy
The documentation for this class was generated from the following file: