SDL_GetTraySubmenu(3)

πŸ’– SDL_GetTraySubmenu(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we talk about getting your lil tray submenu back πŸŽ€


✨ NAME ✨

SDL_GetTraySubmenu</puruple> β€” gets a previously created tray entry submenu. no cap, that's the whole job πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_tray.h>

SDL_TrayMenu * SDL_GetTraySubmenu(SDL_TrayEntry *entry);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: at some point you should have called SDL_CreateTraySubmenu() on the entry object. like, that's the prerequisite, queen πŸ‘‘. and this function? it lets you fetch it again later. that's it, that's the whole thing.

this function does the same thing as SDL_GetTrayMenu(), except β€” and this is the plot twist β€” it takes a SDL_TrayEntry instead of a SDL_Tray. the way that it's literally the same energy but with a different type 😭

and here's the good news, the part that's giving stress-free:

a menu does not need to be destroyed. it will be destroyed with the tray. so don't you dare go freeing it yourself, bestie 🫢

πŸ’œ FUNCTION PARAMETERS πŸ’œ

  • entry β€” the tray entry to bind the menu to.

⭐ RETURN VALUE ⭐

returns the newly created menu. periodt. ✨


πŸ”₯ THREAD SAFETY πŸ”₯

this function should be called on the thread that created the tray. so like, same thread, no games, iykyk 🧚


🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. iconic behavior honestly πŸ‘‘


πŸŽ€ SEE ALSO πŸŽ€


and that's a wrap on our lil tray submenu moment πŸ’– this cutie came to you courtesy of Simple Directmedia Layer, straight out of the SDL 3.4.18 era, filed under SDL3 FUNCTIONS. slay, go build something cute, and remember: the tray destroys the menu, not you. bye bestie πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from