sdl3-bindgen-sys
Safe HaskellNone
LanguageGHC2021

SDL3.Sys.Bindgen.Messagebox.Safe

Synopsis

Documentation

sDL_ShowMessageBox Source #

Arguments

:: PtrConst SDL_MessageBoxData
messageboxdata
the SDL_MessageBoxData structure with title, text and other options.
-> Ptr CInt
buttonid
the pointer to which user id of hit button should be copied.
-> IO CBool 

Create a modal message box.

If your needs aren't complex, it might be easier to use SDL_ShowSimpleMessageBox.

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.

Returns
true on success or false on failure; call SDL_GetError() for more information.
Thread safety
This function should only be called on the main thread.
See also
sDL_ShowSimpleMessageBox
C declaration
SDL_ShowMessageBox, defined at SDL3/SDL_messagebox.h 177:34

Since: 3.2.0

sDL_ShowSimpleMessageBox Source #

Arguments

:: SDL_MessageBoxFlags
flags
an SDL_MessageBoxFlags value.
-> PtrConst CChar
title
UTF-8 title text.
-> PtrConst CChar
message
UTF-8 message text.
-> Ptr SDL_Window
window
the parent window, or NULL for no parent.
-> IO CBool 

Display a simple modal message box.

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.

Returns
true on success or false on failure; call SDL_GetError() for more information.
Thread safety
This function should only be called on the main thread.
See also
sDL_ShowMessageBox
C declaration
SDL_ShowSimpleMessageBox, defined at SDL3/SDL_messagebox.h 221:34

Since: 3.2.0