I didn't do anything with PB for quite a long time, and I'm still using 4.00. Today, I tried to write a little GUI for an command line application, but somehow my string gadget (used for status messages) is not being updated while RunProgram runs.
As soon as RunProgram is finished, all the messages show up at once. This is pretty annoying since I need those status texts during the process. Code is like this:
Code: Select all
global TIMER1.l, TIMER2.l
procedure MyThread(NULL)
runprogram("MyApp.exe", "MyParams", GetCurrentDirectory(), #PB_Program_Wait|#PB_Program_Hide)
endprocedure
TIMER1 = GetTickCount_()
xxx = createthread(@MyThread(), #NULL)
While IsThread(xxx) <> 0
TIMER2 = GetTickCount_()
If TIMER2 - TIMER1 >= 1000
SetGadgetText(#MyStringGadget, GetGadgetText(#MyStringGadget) + "#")
TIMER1 = GetTickCount_()
EndIf
Wend