logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_ShowMessageBox - Create a modal message box.

Availability

       This function is available since SDL 3.2.0.

Description

       If your needs aren't complex, it might be easier to use

       SDL_ShowSimpleMessageBox .

       This function should be called on the thread that created the parent window, or on the main thread if the
       messagebox has no parent. It will block execution of that thread until the user clicks a button or closes
       the messagebox.

       This function may be called at any time, even before

       SDL_Init  ().  This  makes  it  useful for reporting errors like a failure to create a renderer or OpenGL
       context.

       On X11, SDL rolls its own dialog box with X11 primitives instead of a formal toolkit like GTK+ or Qt.

       Note that if SDL_Init () would fail because there isn't any available  video  target,  this  function  is
       likely  to fail for the same reasons. If this is a concern, check the return value from this function and
       fall back to writing to stderr if you can.

Function Parameters

messageboxdata
              the SDL_MessageBoxData
               structure with title, text and other options.

       buttonid
              the pointer to which user id of hit button should be copied.

Header File

       Defined in SDL3/SDL_messagebox.h

Name

       SDL_ShowMessageBox - Create a modal message box.

Return Value

       Returns true on success or false on failure; call

       SDL_GetError () for more information.

See Also

(3), SDL_ShowSimpleMessageBox(3)

Simple Directmedia Layer                           SDL 3.2.10                              SDL_ShowMessageBox(3)

Synopsis

#include"SDL3/SDL.h"boolSDL_ShowMessageBox(constSDL_MessageBoxData*messageboxdata,int*buttonid);

See Also