SDL_InsertTrayEntryAt(3)
π SDL_InsertTrayEntryAt(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we're talking about SDL_InsertTrayEntryAt β yes, the tray one, the little menu that lives in your system tray, and yes it's about to get cute AND correct, no cap. π
β¨ NAME β¨
SDL_InsertTrayEntryAt β insert a tray entry at a given position. that's it, that's the whole job. lowkey iconic. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_tray.h>
SDL_TrayEntry * SDL_InsertTrayEntryAt(SDL_TrayMenu *menu, int pos, const char *label, SDL_TrayEntryFlags flags);
she takes a menu, a position, a label and some flags, and she gives you back an entry. main character behavior fr fr. β¨
π¦ DESCRIPTION π¦
so here's the vibe: if label is NULL, the entry you get is a separator β a lil divider line, not a clickable thing. and heads up bestie, many functions won't work for an entry that is a separator. it's giving "decorative only", iykyk. π
and the best part? an entry does not need to be destroyed. nope. not your problem. it gets destroyed with the tray, automatically, like the tray is its parent and it's just tagging along. π«Ά
π FUNCTION PARAMETERS π
menuβ the menu you're appending the entry to. the place. the venue. the group chat. π¬posβ the desired position for the new entry. everything at or following this spot gets moved (yes, shoved over, respectfully π). and ifposis-1, the entry just gets appended to the end. easy.labelβ the text shown on the entry, in UTF-8 encoding, orNULLif you want a separator instead. pick your fighter. πflagsβ a combination of flags, some of which are mandatory. so like, don't skip them, bestie, they're not optional-optional. β οΈ
β RETURN VALUE β
returns the shiny newly created entry β¨ β or NULL if pos is out of bounds. so if you get NULL back, that's not a mystery, that's just bad coordinates. π«
π§ THREAD SAFETY π§
this function should be called on the thread that created the tray. do not cheat on that thread. do not show up from a random other thread. she will know. π
π AVAILABILITY π
this function is available since SDL 3.2.0. so if you're on something older... no she's not there yet, sorry babe. π
π SEE ALSO π
go read those next, bestie, the lore goes deep. πΈ
quick reminder: separators are real entries but limited β many functions won't work on them. don't build your whole menu out of dividers and then act surprised. π
okay and that's a wrap!! this page came to you courtesy of Simple Directmedia Layer, rocking version SDL 3.4.18 β slay, periodt. π β¨π go insert some tray entries, you've got this. π¦π
π¦ 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