The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL message box
Naith


Joined: 03 Jul 2014
Posts: 158
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?
SDL message box
Jonas Kulla
Guest

2015-01-17 15:10 GMT+01:00 Naith:
Quote:
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.
SDL message box
Jonas Kulla
Guest

2015-01-17 15:10 GMT+01:00 Naith:
Quote:
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.
SDL message box
Jonas Kulla
Guest

2015-01-17 15:10 GMT+01:00 Naith:
Quote:
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.
SDL message box
Jonas Kulla
Guest

2015-01-17 15:10 GMT+01:00 Naith:
Quote:
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.
SDL message box
Jonas Kulla
Guest

2015-01-17 15:10 GMT+01:00 Naith:
Quote:
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.
SDL message box
Jonas Kulla
Guest

2015-01-17 15:10 GMT+01:00 Naith:
Quote:
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.
SDL message box
Jonas Kulla
Guest

2015-01-17 15:10 GMT+01:00 Naith:
Quote:
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.
SDL message box
Jonas Kulla
Guest

2015-01-17 15:10 GMT+01:00 Naith:
Quote:
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.
SDL message box
Jonas Kulla
Guest

2015-01-17 15:10 GMT+01:00 Naith:
Quote:
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.
SDL message box
Daniel Gibson
Guest

On 01/17/2015 03:11 PM, Naith wrote:
Quote:
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?


Why did you sent this message (with only minor changes) three times?

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL message box
Daniel Gibson
Guest

On 01/17/2015 03:11 PM, Naith wrote:
Quote:
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?


Why did you sent this message (with only minor changes) three times?

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL message box
Daniel Gibson
Guest

On 01/17/2015 03:11 PM, Naith wrote:
Quote:
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?


Why did you sent this message (with only minor changes) three times?

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: SDL message box
Naith


Joined: 03 Jul 2014
Posts: 158
Jonas Kulla wrote:
2015-01-17 15:10 GMT+01:00 Naith
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.

Thanks for the answer.

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

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Because I wasn't pleased with the text and the edit-function is (for some reason) disabled...
Naith


Joined: 03 Jul 2014
Posts: 158
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?
SDL message box
Jonas Kulla
Guest

2015-01-17 19:37 GMT+01:00 Naith:
Quote:
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).
SDL message box
Daniel Gibson
Guest

Am 17.01.2015 19:35, schrieb Naith:
Quote:

Daniel Gibson wrote:
On 01/17/2015 03:11 PM, Naith 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,
Daniel

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: SDL message box
Naith


Joined: 03 Jul 2014
Posts: 158
Jonas Kulla wrote:
2015-01-17 19:37 GMT+01:00 Naith:
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).

Oh, okay. I'm on Windows 7, 64 bit version.

Any idea regarding the coloring-issue?