SDL_MessageBoxButtonData(3type)

πŸ’– SDL_MessageBoxButtonData(3type) πŸ’–

okay bestie, welcome to the SDL3 DATATYPES corner of the manual, where we talk about the little building blocks that make big shiny things happen ✨


🌸 NAME 🌸

SDL_MessageBoxButtonData β€” it's the data for one single button, that's it, that's the whole vibe. Individual button data. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

first things first, you gotta pull in the header, no cap:

#include <SDL3/SDL_messagebox.h>

and here's the struct itself, look at her, she's so simple, she's iconic:

typedef struct SDL_MessageBoxButtonData
{
    SDL_MessageBoxButtonFlags flags;
    int buttonID;       /**< User defined button id (value returned via SDL_ShowMessageBox) */
    const char *text;   /**< The UTF-8 button text */
} SDL_MessageBoxButtonData;

let's break down the three fields, because the way that each one carries its weight?? obsessed 🫢

  • flags β€” it's an SDL_MessageBoxButtonFlags, so the button's flag situation lives here.
  • buttonID β€” your user defined button id. this is the value that gets handed back to you via SDL_ShowMessageBox, so like, this is how you know which button the person actually tapped πŸ‘€
  • text β€” a const char *, and it's the UTF-8 button text. so write it in UTF-8, bestie, don't be weird about it πŸ’€

✨ AVAILABILITY ✨

this struct has been around since SDL 3.2.0, so she's not new new, she's established. queen behavior πŸ‘‘


and that's the whole page, you ate that fr fr πŸ’–

this little datatype page comes to you from Simple Directmedia Layer, sitting pretty at version SDL 3.4.18 🌈 thanks for reading, mwah, go build something cute πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from