Maybe a silly question...
Does PostEvent only works if a window is open?
With OpenConsole I get no custom events captured...
Tried to map the websockets callback to events and saw, no event was captured until I opened a window...
Desired behaviour?
From the PB example:
Code: Select all
; All our custom events
Enumeration #PB_Event_FirstCustomValue
#EventBeginProcessing
#EventProcessingFinished
EndEnumeration
Procedure Thread(Value)
PostEvent(#EventBeginProcessing, 1, 2)
Delay(3000)
PostEvent(#EventProcessingFinished, 1, 2)
EndProcedure
Procedure onBeginProcessing()
Debug "Thread begin processing "
EndProcedure
procedure onProcessingFinished()
debug "Thread processing finished"
EndProcedure
OpenWindow(0, 200, 200, 100, 100, "PostEvent", #PB_Window_Invisible) ; no window, no WaitWindowEvent() -> o.k.
CreateThread(@Thread(), 0)
bindevent(#EventBeginProcessing, @onBeginProcessing())
bindevent(#EventProcessingFinished, @onProcessingFinished())
if OpenConsole("Test")
repeat
delay(100)
Event = WaitWindowEvent() ; -> no WaitWindowEvent(), no events at all?
forever
endif
; Repeat
; Event = WaitWindowEvent()
; Until Event = #PB_Event_CloseWindow
Thanks!