SDL Wiki
[ front page | index | search | recent changes | git repo | offline html ]

SDL_SetTrayMenuShownCallback

Sets a callback to be invoked when the menu is shown or hidden.

Header File

Defined in <SDL3/SDL_tray.h>

Syntax

void SDL_SetTrayMenuShownCallback(SDL_TrayMenu *menu, SDL_TrayMenuShownCallback callback, void *userdata);

Function Parameters

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.

Remarks

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.

Thread Safety

This function should be called on the thread that created the tray.

Version

This function is available since SDL 3.6.0.

See Also


CategoryAPI, CategoryAPIFunction, CategoryTray


[ edit | delete | history | feedback | raw ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.