SDL Wiki
(This is the documentation for SDL3, which is the current stable version. SDL2 was the previous version!)

SDL_ShowSimpleMessageBox

Display a simple modal message box.

Header File

Defined in <SDL3/SDL_messagebox.h>

Syntax

bool SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char *title, const char *message, SDL_Window *window);

Function Parameters

SDL_MessageBoxFlags flags an SDL_MessageBoxFlags value.
const char * title UTF-8 title text.
const char * message UTF-8 message text.
SDL_Window * window the parent window, or NULL for no parent.

Return Value

(bool) Returns true on success or false on failure; call SDL_GetError() for more information.

Remarks

If your needs aren't complex, this function is preferred over SDL_ShowMessageBox.

flags may be any of the following:

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.

Version

This function is available since SDL 3.1.3.

See Also


CategoryAPI, CategoryAPIFunction, CategoryMessagebox


[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.