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

SDL_ShowTrayMenu

Show the tray menu.

Header File

Defined in <SDL3/SDL_tray.h>

Syntax

bool SDL_ShowTrayMenu(SDL_Tray *tray, const SDL_FPoint *position);

Function Parameters

SDL_Tray * tray the tray icon whose menu should be shown.
const SDL_FPoint * position the position to show the menu in global screen coordinates, or NULL to use the default position.

Return Value

(bool) Returns true on success or false on failure; call SDL_GetError() for more information.

Remarks

This can be used to show the tray menu from an activate callback, for example to decide whether to show the menu based on application state.

On Windows, the menu is shown at the given position, or at the mouse position if it's NULL. To show the menu where the tray icon was activated, pass the position given to the activate callback. On macOS, the menu is always shown below the tray icon.

This is not supported on Linux, where the desktop environment decides when to show the tray menu.

Thread Safety

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

Version

This function is available since SDL 3.6.0.


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.