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 be NULL. πŸ–ΌοΈ
  • tooltip β€” a tooltip to be displayed when the mouse hovers the icon, in UTF-8 encoding. Not supported on all platforms. May be NULL. πŸ’¬

⭐ 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