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_
Message BoxButton Data - Individual button data.
- SDL_
Message BoxColor - RGB value used in a message box color scheme
- SDL_
Message BoxColor Scheme - A set of colors to use for message box dialogs
- SDL_
Message BoxColor Type - An enumeration of indices inside the colors array of
SDL_MessageBoxColorScheme
. - SDL_
Message BoxData - 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_
Show ⚠Message Box - Create a modal message box.
- SDL_
Show ⚠Simple Message Box - Display a simple modal message box.
Type Aliases§
- SDL_
Message BoxButton Flags SDL_MessageBoxButtonData
flags.- SDL_
Message BoxFlags - Message box flags.