I just wrote this:
which seems to be a good way to trap Window events yet still let the normal blitz code handle key presses and mouse events. Thought I'd share and see if anyone can improve it as I may not be using it in the best way. Anyway seems to work well for me.
Strict Graphics 800,600,0 Local EventList: TList = New TList While Not KeyHit(KEY_ESCAPE) Cls DrawText "Press <Escape> or click the window X to close",0,0 Flip EventList.Clear() 'Check all the events in the queue and react to any that we need to. While PeekEvent() PollEvent() Select EventID() Case EVENT_APPTERMINATE End Default 'we didn't use it so store it EventList.AddLast(CurrentEvent) End Select Wend 'Now post the events back. For Local E:TEvent = EachIn EventList PostEvent(E) Next Wend
which seems to be a good way to trap Window events yet still let the normal blitz code handle key presses and mouse events. Thought I'd share and see if anyone can improve it as I may not be using it in the best way. Anyway seems to work well for me.