But about OS Windows is not written.The window event loop should not be processed in a thread, as there is some limitation on OS X and Linux. A debugger error will be raised.
Does this mean that in OS Windows it is permissible to create windows in threads?
Will this code work without failures and errors?
Code: Select all
CompilerIf #PB_Compiler_Thread=0
CompilerError "Please enable thread safe"
CompilerEndIf
Procedure ThreadWindow(*Param)
DisableDebugger
OpenWindow(1, 0, 0, 300, 200, "Thread window", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
EnableDebugger
Repeat
DisableDebugger
Event = WaitWindowEvent()
EnableDebugger
Until Event = #PB_Event_CloseWindow And EventWindow() = 1
EndProcedure
OpenWindow(0, 0, 0, 500, 400, "Main window", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
CreateThread(@ThreadWindow(), 0)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow And EventWindow() = 0