I am a bit surprised about these #PB_Event_None events.
It doesn't match the description in the help, does it?
I copied the following text from help:
andWaitWindowEvent()
Wait until an event occurs. It's the same function as WindowEvent() but locks the program execution, which is very important in a multitasking environment.
And here is the small code to show the reason for my confusion......Timeout (optional) => The timeout (in milliseconds) which causes the function to return if no events are occurring. If no timeout is specified, it will wait infinitely until an event occurs.
Code: Select all
EnableExplicit
Macro Trace(Message)
AddGadgetItem(1, -1, Message)
Debug ">> " + Message
EndMacro
If OpenWindow(1, 0, 0, 400, 200, "Window Caption", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ListViewGadget(1, 0, 0, 400, 200) ; <== shows the messages
Repeat ; .. main loop
Select WaitWindowEvent() ; <== no Timeout defined, as far as I can see (?)
Case #PB_Event_None
Trace("None Window Event w/o timeout ?") ; <== at program start this is received six times. (?)
Case #PB_Event_CloseWindow
Break ; done with main loop
EndSelect
ForEver
EndIf