SDL message box

Hi!

I’m trying to create a message box (SDL_ShowMessageBox, not SDL_ShowSimpleMessageBox) with buttons in it and I now have 2 issues / questions:

  1. How does the color scheme for a specific button work? I know there is a colorScheme pointer inside the SDL_MessageBoxData, which I’ve created, but even if I, for example, set the SDL_MESSAGEBOX_COLOR_BACKGROUND to red, the message box background color is the default (gray). Am I missing something?

  2. How can I prevent the user from access the SDL window when the message box is open? When I have a message box open and the user clicks on the SDL window (which is behind the message box), I want the focus to return / remain on the message box. Can this be done?

Why did you sent this message (with only minor changes) three times?On 01/17/2015 03:11 PM, Naith wrote:

Hi!

I’m trying to create a message box (SDL_ShowMessageBox, not
SDL_ShowSimpleMessageBox) with buttons in it and I now have 2 issues /
questions:

  1. How does the color scheme for the message box work? I know there is a
    colorScheme pointer inside the SDL_MessageBoxData, which I’ve created,
    but even if I, for example, set the SDL_MESSAGEBOX_COLOR_BACKGROUND to
    red, the message box background color is the default (gray). Am I
    missing something?

  2. How can I prevent the user from access the SDL window when the
    message box is open? When I have a message box open and the user clicks
    on the SDL window (which is behind the message box), I want the focus to
    return / remain on the message box. Can this be done?

2015-01-17 15:10 GMT+01:00 Naith :

Hi!

I’m trying to create a message box (SDL_ShowMessageBox, not
SDL_ShowSimpleMessageBox) with buttons in it and I now have 2 issues /
questions:

  1. How does the color scheme for a specific button work? I know there is a
    colorScheme pointer inside the SDL_MessageBoxData, which I’ve created, but
    even if I, for example, set the SDL_MESSAGEBOX_COLOR_BACKGROUND to red, the
    message box background color is the default (gray). Am I missing something?

  2. How can I prevent the user from access the SDL window when the message
    box is open? When I have a message box open and the user clicks on the SDL
    window (which is behind the message box), I want the focus to return /
    remain on the message box. Can this be done?

For 2), the SDL_MessageBoxData struct has a “window” member to specify the
parent SDL_Window, this
should be enough for the platform code to make the message box transient
for your main window so it
stays on top.

Daniel Gibson wrote:
Why did you sent this message (with only minor changes) three times?

Because I wasn’t pleased with the text and the edit-function is (for
some reason) disabled…

The edit function is disabled because the forum is synchronized with a
mailing list (where editing or deleting posts is impossible).

Please don’t do that.
If you want to add something to your post, just answer to your original
post, don’t duplicate it.

Thanks!

Cheers,
DanielAm 17.01.2015 19:35, schrieb Naith:

On 01/17/2015 03:11 PM, Naith wrote:

2015-01-17 19:37 GMT+01:00 Naith :

And of course I forgot to mention this:

Jonas, my SDL window is specified in my SDL_MessageBoxData struct but the
window still won’t stay “in the background” when it is clicked. What can be
the reason for that?

What operating system are you on? On Linux/X11, the parent window properly
stays
behind the message box on my system (although it can gain keyboard focus).