Wiki Page Content

Differences between revisions 1 and 2
Revision 1 as of 2013-08-14 06:50:09
Size: 1078
Editor: andred
Comment:
Revision 2 as of 2013-08-15 05:02:36
Size: 1674
Editor: RyanGordon
Comment: Added remarks and code example.
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
||<tablewidth="100%" style="color: #FF0000;" :> DRAFT||
Line 16: Line 15:
||'''flags'''||An SDL_MessageBoxFlag; see Remarks for details;|| ||'''flags'''||An SDL_MessageBoxFlag; see [[#flags|Remarks]] for details;||
Line 26: Line 25:
You can add your code example here SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
                         "Missing file",
                         "File is missing. Please reinstall the program.",
                         NULL);
Line 35: Line 37:
----
[[CategoryAPI]], [[CategoryHeader]]
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.

SDL_ShowSimpleMessageBox

Use this function to display a simple message box.

Syntax

int SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window)

Function Parameters

flags

An SDL_MessageBoxFlag; see Remarks for details;

title

UTF-8 title text

message

UTF-8 message text

window

the parent window, or NULL for no parent

Return Value

0 on success or a negative error code on failure; call SDL_GetError() for more information.

Code Examples

SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, 
                         "Missing file",
                         "File is missing. Please reinstall the program.",
                         NULL);

Remarks

flags may be any of the following:

SDL_MESSAGEBOX_ERROR

error dialog

SDL_MESSAGEBOX_WARNING

warning dialog

SDL_MESSAGEBOX_INFORMATION

informational dialog

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.


CategoryAPI

None: SDL_ShowSimpleMessageBox (last edited 2014-09-24 20:33:51 by PhilippWiesemann)

Feedback
Please include your contact information if you'd like to receive a reply.
Submit