SDL3pp
A slim C++ wrapper for SDL3
|
An opaque handle representing an entry on a system tray object. More...
Public Member Functions | |
TrayMenu | CreateSubmenu () |
Create a submenu for a system tray entry. | |
TrayMenu | GetSubmenu () |
Gets a previously created tray entry submenu. | |
void | SetLabel (StringParam label) |
Sets the label of an entry. | |
const char * | GetLabel () const |
Gets the label of an entry. | |
void | SetChecked (bool checked) |
Sets whether or not an entry is checked. | |
bool | GetChecked () const |
Gets whether or not an entry is checked. | |
void | SetEnabled (bool enabled) |
Sets whether or not an entry is enabled. | |
bool | GetEnabled () const |
Gets whether or not an entry is enabled. | |
void | SetCallback (TrayCB callback) |
Sets a callback to be invoked when the entry is selected. | |
void | SetCallback (TrayCallback callback, void *userdata) |
Sets a callback to be invoked when the entry is selected. | |
void | Click () |
Simulate a click on a tray entry. | |
TrayMenu | GetParent () |
Gets the menu containing a certain tray entry. | |
constexpr | Resource (T resource={}) |
Constructs from the underlying resource. | |
constexpr | Resource (const ResourceHandle< Resource< T > > auto &resource) |
Constructs from pointer like. | |
constexpr | Resource (std::nullptr_t) |
Equivalent to default ctor. | |
constexpr | Resource (std::nullopt_t) |
Equivalent to default ctor. | |
![]() | |
constexpr | Resource (SDL_TrayEntry * resource={}) |
Constructs from the underlying resource. | |
constexpr | Resource (const ResourceHandle< Resource< SDL_TrayEntry * > > auto &resource) |
Constructs from pointer like. | |
constexpr | Resource (std::nullptr_t) |
Equivalent to default ctor. | |
constexpr | Resource (std::nullopt_t) |
Equivalent to default ctor. | |
constexpr | operator bool () const |
True if contains a valid resource. | |
constexpr | operator value_type () const |
Converts back to underlying type. | |
constexpr bool | operator== (const Resource &other) const=default |
Comparison. | |
constexpr bool | operator== (std::nullopt_t) const |
Comparison. | |
constexpr bool | operator== (std::nullptr_t) const |
Comparison. | |
constexpr SDL_TrayEntry * | get () const |
Return contained resource;. | |
constexpr const SDL_TrayEntry * | operator-> () const |
Access to fields. | |
constexpr SDL_TrayEntry * | operator-> () |
Access to fields. | |
Static Public Member Functions | |
static void | reset (SDL_TrayEntry *resource) |
Removes a tray entry. | |
Additional Inherited Members | |
![]() | |
using | value_type = SDL_TrayEntry * |
The raw resource type. | |
|
inline |
|
inline |
This should be called at most once per tray entry.
This function does the same thing as TrayRef.CreateMenu, except that it takes a TrayEntryRef instead of a TrayRef.
A menu does not need to be destroyed; it will be destroyed with the tray.
|
inline |
The entry must have been created with the TRAYENTRY_CHECKBOX flag.
|
inline |
|
inline |
If the returned value is nullptr, the entry is a separator.
|
inline |
|
inline |
You should have called TrayEntryRef.CreateSubmenu() on the entry object. This function allows you to fetch it again later.
This function does the same thing as TrayRef.GetMenu(), except that it takes a TrayEntryRef instead of a TrayRef.
A menu does not need to be destroyed; it will be destroyed with the tray.
|
inlinestatic |
resource | The entry to be deleted. |
|
inline |
callback | a callback to be invoked when the entry is selected. |
userdata | an optional pointer to pass extra data to the callback when it will be invoked. |
|
inline |
callback | a callback to be invoked when the entry is selected. |
|
inline |
The entry must have been created with the TRAYENTRY_CHECKBOX flag.
checked | true if the entry should be checked; false otherwise. |
|
inline |
enabled | true if the entry should be enabled; false otherwise. |
|
inline |
An entry cannot change between a separator and an ordinary entry; that is, it is not possible to set a non-nullptr label on an entry that has a nullptr label (separators), or to set a nullptr label to an entry that has a non-nullptr label. The function will silently fail if that happens.
label | the new label for the entry in UTF-8 encoding. |