SDL_CreateTray(3)
π SDL_CreateTray(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the group chat, where we're talking about SDL_CreateTray β the function that makes you an icon in the operating system's tray, or the equivalent thing on whatever platform you're on π
β¨ NAME β¨
SDL_CreateTray β Create an icon to be placed in the operating system's tray, or equivalent. π¦
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_tray.h>
SDL_Tray * SDL_CreateTray(SDL_Surface *icon, const char *tooltip);
π DESCRIPTION π
so like, here's the tea β β many platforms advise not using a system tray unless persistence is a necessary feature. Translation: don't just slap a tray icon down because you can, okay? Avoid needlessly creating a tray icon, because the user may feel like it clutters their interface π nobody wants their little corner of the screen looking like a messy desk.
Also, using tray icons requires the video subsystem. no video subsystem, no tray vibes, periodt π
π«Ά FUNCTION PARAMETERS π«Ά
iconβ a surface to be used as icon. May beNULL. πΌοΈtooltipβ a tooltip to be displayed when the mouse hovers the icon, in UTF-8 encoding. Not supported on all platforms. May beNULL. π¬
β RETURN VALUE β
Returns the newly created system tray icon. that's your little guy, your main character, your tray baby π
π§ THREAD SAFETY π§
This function should only be called on the main thread. no side-quest threads for this one, bestie π
π AVAILABILITY π
This function is available since SDL 3.2.0. β¨
π SEE ALSO π
(go read those next, iykyk π)
and that's the whole page, fr fr π this one came straight out of the Simple Directmedia Layer crew, version SDL 3.4.18 β mwah, 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