Used addwindowtimer() set for 1 second.
worked ok.
Now adding more code for the user to make other choices while a song is playing.
Whenever a menu is opened (no choice made) or a combobox is opened (No choice made) the update stops.
I have tried running the update in a thread but get strange memory errors when running, these errors are random and happen in the code anywhere depending on what the user is doing.
I have read that updating a gadget on the main form from a thread is not good practice and when I do not use the thread the errors do not happen.
Below a little code to illustrate the problem.
Code: Select all
Procedure Update()
Static iLoop
iLoop = iLoop + 1
SetGadgetText(2,Str(iLooP) + " Seconds")
EndProcedure
OpenWindow(0,5,5,400,200,"Test Window")
ComboBoxGadget(1,5,5,80,20)
TextGadget(2,90,5,80,20,"Seconds")
For i = 0 To 9
AddGadgetItem(1,-1,"Item " + Str(i))
Next
AddWindowTimer(0,100,1000)
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Timer
UpDate()
EndIf
Until Event = #PB_Event_CloseWindow
Regards
CD