SDL_CreateTraySubmenu(3)

πŸ’– SDL_CreateTraySubmenu πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS page for SDL_CreateTraySubmenu(3) β€” yes that's the manual section number, she's fancy like that. let's get into it ✨


🌸 NAME 🌸

SDL_CreateTraySubmenu β€” Create a submenu for a system tray entry.

like, a menu inside a menu. nesting era. πŸͺ†


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_tray.h>

SDL_TrayMenu * SDL_CreateTraySubmenu(SDL_TrayEntry *entry);

✨ DESCRIPTION ✨

okay so. this one should be called at most once per tray entry. one entry, one submenu. that's the whole vibe. don't be greedy πŸ’…

this function does the same thing as SDL_CreateTrayMenu, except that it takes a SDL_TrayEntry instead of a SDL_Tray. same energy, different argument type, iykyk.

and here's the best part: a menu does not need to be destroyed. it gets destroyed with the tray. no cleanup arc, no manual free, no nothing. it's giving "the tray handles it, you just live your life" πŸ¦‹


🫢 FUNCTION PARAMETERS 🫢

  • entry β€” the tray entry to bind the menu to. that's her. that's the one getting a whole submenu attached. iconic behavior honestly πŸ‘‘

⭐ RETURN VALUE ⭐

Returns the newly created menu. brand new, fresh out of the oven, ready to be filled with stuff πŸ“


🧚 THREAD SAFETY 🧚

this function should be called on the thread that created the tray. not a different thread, bestie. same thread. the tray's thread. periodt. don't cross the streams πŸ’€


🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. so if you're on anything older, sorry babe, no submenu for you 😭


πŸ‘‘ SEE ALSO πŸ‘‘


lowkey a whole submenu system living inside your system tray. main character energy fr fr πŸ’…

okay that's the page!! this one was brought to you by Simple Directmedia Layer, version SDL 3.4.18 β€” go make a tray, make a submenu, make it cute. bye bestie πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from