---
name: "SDL_ShowSimpleMessageBox"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_ShowSimpleMessageBox"
---

# SDL\_ShowSimpleMessageBox(3)

Display a simple modal message box.

## NAME

SDL\_ShowSimpleMessageBox - Display a simple modal message box.

## HEADER FILE

Defined in SDL3/SDL\_messagebox.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**bool SDL\_ShowSimpleMessageBox(SDL\_MessageBoxFlags flags, const char \*title, const char \*message, SDL\_Window \*window);**

## DESCRIPTION

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

**SDL\_ShowMessageBox** . **flags** may be any of the following:

•  **SDL\_MESSAGEBOX\_ERROR** : error dialog

•  **SDL\_MESSAGEBOX\_WARNING** : warning dialog

•  **SDL\_MESSAGEBOX\_INFORMATION** : informational\
   dialog

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

- *flags*

  an  **SDL\_MessageBoxFlags**\
    value.

- *title*

  UTF-8 title text.

- *message*

  UTF-8 message text.

- *window*

  the parent window, or NULL for no parent.

## RETURN VALUE

Returns true on success or false on failure; call

**SDL\_GetError** () for more information.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_ShowMessageBox**(3)](/SDL_ShowMessageBox/3.md)
