SDL_GetTrayMenuParentEntry(3)

✨ SDL_GetTrayMenuParentEntry ✨

okay bestie, welcome to SDL_GetTrayMenuParentEntry(3) β€” yes it's a mouthful, yes it's from the SDL3 functions squad, and yes it's about to make your tray menus make sense πŸ’…


πŸŽ€ NAME πŸŽ€

SDL_GetTrayMenuParentEntry β€” the girl who tells you which entry a menu is a submenu of, when that menu is, in fact, a submenu. no cap, that's the whole job πŸ¦‹


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_tray.h>

SDL_TrayEntry * SDL_GetTrayMenuParentEntry(SDL_TrayMenu *menu);

πŸ’– DESCRIPTION πŸ’–

so here's the vibe check: for literally any given menu, either this function or SDL_GetTrayMenuParentTray() is gonna hand you a non-NULL back. one of them always comes through, bestie. that's the whole dynamic β€” a menu either has a parent tray, or it's living its submenu life nested under an entry, and this function is the one that catches the submenu case 🌈


🫢 FUNCTION PARAMETERS 🫢

  • menu β€” the menu you're asking about, i.e. the menu for which to get the parent entry. it's giving "who's your parent, babe" πŸ’œ

⭐ RETURN VALUE ⭐

Returns the parent entry, or NULL if this menu is not a submenu. no submenu, no parent entry, no drama. the NULL is not a bug, it's just her being honest with you πŸ™ˆ


πŸ”₯ THREAD SAFETY πŸ”₯

this one has RULES, bestie: call it on the thread that created the tray. periodt. don't be out here calling it from a random thread and then acting surprised 😭


πŸ‘‘ AVAILABILITY πŸ‘‘

this function has been serving looks since SDL 3.2.0. iconic behavior, honestly πŸ’…


πŸ’€ SEE ALSO πŸ’€

iykyk, go read those next 🧚


mwah πŸ’‹ that's a wrap β€” brought to you by the Simple Directmedia Layer girlies, page version SDL 3.4.18. slay, bye bestie! πŸ“

πŸ“¦ where this page comes from