Module messagebox

Available on crate feature dep_sdl3 only.
Expand description

SDL offers a simple message box API, which is useful for simple alerts, such as informing the user when something fatal happens at startup without the need to build a UI for it (or informing the user before your UI is ready).

These message boxes are native system dialogs where possible.

There is both a customizable function (SDL_ShowMessageBox()) that offers lots of options for what to display and reports on what choice the user made, and also a much-simplified version (SDL_ShowSimpleMessageBox()), merely takes a text message and title, and waits until the user presses a single “OK” UI button. Often, this is all that is necessary.

Structs§

SDL_MessageBoxButtonData
Individual button data.
SDL_MessageBoxColor
RGB value used in a message box color scheme
SDL_MessageBoxColorScheme
A set of colors to use for message box dialogs
SDL_MessageBoxColorType
An enumeration of indices inside the colors array of SDL_MessageBoxColorScheme.
SDL_MessageBoxData
MessageBox structure containing title, text, window, etc.

Constants§

SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT
buttons placed left to right
SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT
buttons placed right to left
SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT
Marks the default button when escape is hit
SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT
Marks the default button when return is hit
SDL_MESSAGEBOX_COLOR_BACKGROUND
SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND
SDL_MESSAGEBOX_COLOR_BUTTON_BORDER
SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED
SDL_MESSAGEBOX_COLOR_COUNT
Size of the colors array of SDL_MessageBoxColorScheme.
SDL_MESSAGEBOX_COLOR_TEXT
SDL_MESSAGEBOX_ERROR
error dialog
SDL_MESSAGEBOX_INFORMATION
informational dialog
SDL_MESSAGEBOX_WARNING
warning dialog

Functions§

SDL_ShowMessageBox
Create a modal message box.
SDL_ShowSimpleMessageBox
Display a simple modal message box.

Type Aliases§

SDL_MessageBoxButtonFlags
SDL_MessageBoxButtonData flags.
SDL_MessageBoxFlags
Message box flags.