Sets a callback to be invoked when the menu is shown or hidden.
Defined in <SDL3/SDL_tray.h>
void SDL_SetTrayMenuShownCallback(SDL_TrayMenu *menu, SDL_TrayMenuShownCallback callback, void *userdata);| SDL_TrayMenu * | menu | the menu to be updated. |
| SDL_TrayMenuShownCallback | callback | a callback to be invoked when the menu is shown or hidden. |
| void * | userdata | an optional pointer to pass extra data to the callback when it will be invoked. |
The callback is invoked before the menu is displayed, so it can be used to update the menu contents. This works for both tray menus and submenus.
On Linux, the desktop environment may report that a menu is being shown more than once, and may not report when it is hidden.
This function should be called on the thread that created the tray.
This function is available since SDL 3.6.0.