SDL_SetTrayIcon(3)

πŸ’– SDL_SetTrayIcon πŸ’–

okay bestie, welcome to the SDL_SetTrayIcon(3) page, from the SDL3 FUNCTIONS manual 🫢 this one's short and sweet and it's literally just "swap out the little picture in your system tray" energy. iconic. let's go ✨


✨ NAME ✨

SDL_SetTrayIcon β€” updates the system tray icon's icon. that's it, that's the whole job πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_tray.h>

void SDL_SetTrayIcon(SDL_Tray *tray, SDL_Surface *icon);

no return value, she just does it. main character behavior fr fr πŸ‘‘


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • tray β€” the tray icon that's getting updated. this is the one you're messing with πŸ–ΌοΈ
  • icon β€” the new icon. and yes, it may be NULL. so null is a legal vibe here, no cap πŸ’€

🧡 THREAD SAFETY 🧡

ok so this is the part where you have to be careful, bestie 😭 this function should be called on the thread that created the tray. not a random thread. not your friend's thread. the thread. the one that made the tray. periodt 🚫🧡


πŸ¦‹ AVAILABILITY πŸ¦‹

this one's been around since SDL 3.2.0 🌈 so if you're on something older, sorry babe, she's not there yet πŸ™ˆ


⭐ SEE ALSO ⭐

  • SDL_CreateTray(3) β€” like, you kinda need a tray before you can set its icon, so maybe start there? just a thought πŸ’­πŸ’–

and that's the whole page, gorgeous πŸŽ€ this was the Simple Directmedia Layer crew, shipping SDL 3.4.18, and honestly? obsessed with them for it. go set some tray icons, you absolute legend πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from