SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::TrayMenu Class Reference

An opaque handle representing a menu/submenu on a system tray object. More...

Public Member Functions

constexpr TrayMenu (TrayMenuRaw trayMenu={})
 Wraps TrayMenu. More...
 
constexpr operator TrayMenuRaw () const
 Unwraps to the underlying TrayMenu. More...
 
std::span< TrayEntryGetEntries ()
 Returns a list of entries in the menu, in order. More...
 
TrayEntry InsertEntry (int pos, StringParam label, TrayEntryFlags flags)
 Insert a tray entry at a given position. More...
 
TrayEntry AppendEntry (StringParam label, TrayEntryFlags flags)
 Appends a tray entry. More...
 
TrayEntryParam GetParentEntry () const
 Gets the entry for which the menu is a submenu, if the current menu is a submenu. More...
 
TrayParam GetParentTray () const
 Gets the tray for which this menu is the first-level menu, if the current menu isn't a submenu. More...
 

Detailed Description

Since
This struct is available since SDL 3.2.0.

Constructor & Destructor Documentation

◆ TrayMenu()

constexpr SDL::TrayMenu::TrayMenu ( TrayMenuRaw  trayMenu = {})
inlineconstexpr
Parameters
trayMenuthe value to be wrapped

Member Function Documentation

◆ AppendEntry()

TrayEntry SDL::TrayMenu::AppendEntry ( StringParam  label,
TrayEntryFlags  flags 
)
inline

If label is nullptr, the entry will be a separator. Many functions won't work for an entry that is a separator.

An entry does not need to be destroyed; it will be destroyed with the tray.

Parameters
labelthe text to be displayed on the entry, in UTF-8 encoding, or nullptr for a separator.
flagsa combination of flags, some of which are mandatory.
Returns
the newly created entry, or nullptr if pos is out of bounds.
Thread safety:
This function should be called on the thread that created the tray.
Since
This function is available since SDL 3.2.0.
See also
TrayMenu.InsertEntry
TrayEntryFlags
TrayMenu.GetEntries
TrayEntry.Remove
TrayEntry.GetParent

◆ operator TrayMenuRaw()

constexpr SDL::TrayMenu::operator TrayMenuRaw ( ) const
inlineconstexpr
Returns
the underlying TrayMenuRaw.

The documentation for this class was generated from the following file: