MessageBox structure containing title, text, window, etc.
More...
- Since
- This struct is available since SDL 3.2.0.
◆ MessageBox() [1/2]
constexpr SDL::MessageBox::MessageBox |
( |
const SDL_MessageBoxData & |
messageBox = {} | ) |
|
|
inlineconstexpr |
- Parameters
-
messageBox | the value to be wrapped |
◆ MessageBox() [2/2]
- Parameters
-
flags | the value for flags. |
window | the value for window. |
title | the value for title. |
message | the value for message. |
buttons | the value for buttons. |
colorScheme | the value for colorScheme. |
◆ GetButtons()
- Returns
- current buttons value.
◆ GetColorScheme()
- Returns
- current colorScheme value.
◆ GetFlags()
constexpr SDL_MessageBoxFlags SDL::MessageBox::GetFlags |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- current flags value.
◆ GetMessage()
constexpr const char * SDL::MessageBox::GetMessage |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- current message value.
◆ GetTitle()
constexpr const char * SDL::MessageBox::GetTitle |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- current title value.
◆ GetWindow()
constexpr WindowRef SDL::MessageBox::GetWindow |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- current window value.
◆ SetButtons()
- Parameters
-
newButtons | the new buttons value. |
- Returns
- Reference to self.
◆ SetColorScheme()
- Parameters
-
newColorScheme | the new colorScheme value. |
- Returns
- Reference to self.
◆ SetFlags()
constexpr MessageBox & SDL::MessageBox::SetFlags |
( |
SDL_MessageBoxFlags |
newFlags | ) |
|
|
inlineconstexpr |
- Parameters
-
newFlags | the new flags value. |
- Returns
- Reference to self.
◆ SetMessage()
constexpr MessageBox & SDL::MessageBox::SetMessage |
( |
const char * |
newMessage | ) |
|
|
inlineconstexpr |
- Parameters
-
newMessage | the new message value. |
- Returns
- Reference to self.
◆ SetTitle()
constexpr MessageBox & SDL::MessageBox::SetTitle |
( |
const char * |
newTitle | ) |
|
|
inlineconstexpr |
- Parameters
-
newTitle | the new title value. |
- Returns
- Reference to self.
◆ SetWindow()
- Parameters
-
newWindow | the new window value. |
- Returns
- Reference to self.
◆ Show()
void SDL::MessageBox::Show |
( |
int * |
buttonid | ) |
const |
|
inline |
If your needs aren't complex, it might be easier to use 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 InitSubSystem(). 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 InitSubSystem() 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.
- Parameters
-
buttonid | the pointer to which user id of hit button should be copied. |
- Exceptions
-
- Since
- This function is available since SDL 3.2.0.
- See also
- ShowSimpleMessageBox
The documentation for this struct was generated from the following file: