[SDL] Dialog boxes.

John Popplewell john at johnnypops.demon.co.uk
Mon Mar 13 14:33:01 PST 2006


On Mon, Mar 13, 2006 at 09:22:00PM +0100, Tomas Jakobsson wrote:
> This is the code i use in the regular win32 code:
> 
> while (PeekMessage (&Message, NULL, 0, 0, PM_REMOVE))
> {
>     TranslateMessage (&Message);
>     DispatchMessage  (&Message);
> 
>     if (Message.message == WM_QUIT)
>         pBase->Quit = TRUE;
> }
> 
> and this is the code i use in the SDL code:
> 
> while (SDL_PollEvent (&Event))
> {
>     ... lots and lots of code to grab input and other stuff
> }
> 
> Which is run each frame.
> I just did a test and ran both the SDL_PollEvents loop AND the plain win32 
> PeekMessage thing right before creating my DialogBox just to be sure that 
> all messages are flushed out and it still wont show up.
> A simple MessageBox works just fine tho.
> 
> MessageBox (NULL, "Test", "Test", MB_OK);
> 
> // Tomaz
> 
Tomaz,

the attached code displays an OpenGL/SDL window and a modeless dialog.
I'm using the current CVS version of SDL. Works OK here.

Please show us a small, complete example that exhibits the problem,

best regards,
John.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: resource.h
Type: text/x-chdr
Size: 91 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060313/92577ac3/attachment.h>
-------------- next part --------------
#include "winuser.h"

#include "resource.h"



/////////////////////////////////////////////////////////////////////////////

//

// Dialog

//



IDD_DIALOG_LIGHTS DIALOG DISCARDABLE  0, 0, 186, 61

STYLE DS_MODALFRAME|WS_POPUP|WS_CAPTION|WS_SYSMENU

CAPTION "Modeless Dialog"

FONT 8, "MS Sans Serif"

BEGIN

    DEFPUSHBUTTON   "OK",IDOK,65,35,55,14

    CTEXT           "Click to Close!",IDC_ERROR_TEXT,40,15,110,20

END



-------------- next part --------------
A non-text attachment was scrubbed...
Name: modeless.c
Type: text/x-csrc
Size: 1729 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060313/92577ac3/attachment.c>


More information about the SDL mailing list