SDL_CreateTrayMenu(3)
π SDL_CreateTrayMenu π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages β this one's SDL_CreateTrayMenu(3) and it's lowkey the moment your system tray icon gets a whole menu to call its own. πΈ
β¨ NAME β¨
SDL_CreateTrayMenu β Create a menu for a system tray. π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_tray.h>
SDL_TrayMenu * SDL_CreateTrayMenu(SDL_Tray *tray);
π DESCRIPTION π
so here's the tea: this should be called at most once per tray icon. that's it, that's the rule. one menu per icon, don't be greedy. π
This function does the same thing as SDL_CreateTraySubmenu(), except that it takes a SDL_Tray instead of a SDL_TrayEntry. same energy, different parameter, iykyk. β¨
And the best part?? A menu does not need to be destroyed β it will be destroyed with the tray. no cleanup era required, it's giving self-sufficient queen behavior. π
π FUNCTION PARAMETERS π
trayβ the tray to bind the menu to. that's your girl, the tray icon getting the glow-up. π
β RETURN VALUE β
Returns the newly created menu. fresh out the oven, still warm. π₯
π§ THREAD SAFETY π§
This function should be called on the thread that created the tray. fr fr, don't be out here calling it from some random thread β stay loyal to the one that birthed the tray. π
π AVAILABILITY π
This function is available since SDL 3.2.0. so if you're on anything older, it's not you, it's the version. π
π SEE ALSO π
go read those too, bestie, they're all part of the same friend group. π«Ά
and that's the whole page!! brought to you by the fine folks at Simple Directmedia Layer, version SDL 3.4.18 β slay, iconic, no cap. π β¨πΈ
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms