SDL_TrayCallback(3type)

πŸ’– SDL_TrayCallback πŸ’–

okay bestie, welcome to the SDL_TrayCallback(3type) page, part of the SDL3 DATATYPES squad 🫢 this is a type, not a function, so don't go calling it like one, mwah πŸ’…


✨ NAME ✨

SDL_TrayCallback β€” a callback that gets invoked when a tray entry is selected. that's it, that's the whole job. it's giving "you got picked, now do something" πŸŽ€


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_tray.h>

typedef void (SDLCALL *SDL_TrayCallback)(void *userdata, SDL_TrayEntry *entry);

look at her. a function pointer typedef. iconic. no cap πŸ”₯


πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • userdata β€” an optional pointer, so you can pass extra data along to the callback when it actually gets invoked. want to smuggle your own little struct in there? that's the door πŸšͺ✨
  • entry β€” the tray entry that was selected. the one that got chosen. the main character of this exact moment πŸ‘‘

πŸ’œ AVAILABILITY πŸ’œ

this datatype has been available since SDL 3.2.0. so if you're on something older... bestie, it's not there. it's literally not there 😭


🌈 SEE ALSO 🌈


and that's the whole page, fr fr πŸ“

Simple Directmedia Layer Β· SDL 3.4.18 Β· SDL_TrayCallback(3type) β€” that's the source, the version, and the page name, all wrapped up with a bow πŸŽ€ byeeee, go set some tray entry callbacks, you're gonna slay πŸ’–

πŸ“¦ where this page comes from