Page 2 of 2

Re: windows & gadgets without Repeat : Until

Posted: Fri Aug 27, 2010 1:49 pm
by Trond
It halts because you get stuck in the loop instead of returning from the procedure. If you start the window in a thread, you can return from the procedure and the program won't halt.

Code: Select all

Procedure TestGadgetThread(hwnd.i)

OpenWindow(2500, 0, 0, 0, 0, "test", #PB_Window_Invisible) ;otherwise dll is buggy

UseGadgetList(hwnd) ;to create on another window

WebGadget(0,5,5,500,500,"www.google.com") ;a gadget

Repeat
    Event = WaitWindowEvent()

    If Event = #PB_Event_CloseWindow 
      Quit = 1
    EndIf

  Until Quit = 1


EndProcedure


ProcedureDLL TestGadget(hwnd.s)
  CreateThread(@TestGadgetThread(), Val("$" + hwnd))
  ProcedureReturn 1
EndProcedure

Re: windows & gadgets without Repeat : Until

Posted: Fri Aug 27, 2010 4:01 pm
by cybergeek
it works but crashes application :|