Posted: Mon Mar 04, 2002 1:02 am
Restored from previous forum. Originally posted by El_Choni.
Hi,
I have a little problem with a thread. It's only called when it's supposed to end. This is the calling code:
The procedure is only called when returning from Xpm2Bmp, and inmediatly ended. This is the thread procedure:
This code works if called (uses the PopUpWindow library, yes I know, gadgets are not placed correctly). If you put a requester at the beginning, you'll see it after returning from Xpm2Bmp, not before, as it should.
Any ideas are welcome (come back, Fred! XD),
Bye,
El_Choni
Hi,
I have a little problem with a thread. It's only called when it's supposed to end. This is the calling code:
Code: Select all
Gosub OpenXpm
ProgressExitCode = 0
ThreadID = CreateThread(@Progress(), "Xpm")
Gosub Xpm2Bmp
ProgressExitCode = 1
Gosub ShowImage
Code: Select all
Procedure Progress(format.s)
done = 0
If OpenPopUpWindow(2, WindowX()+(WindowWidth()>>1)-128, WindowY()+(WindowHeight()>>1)-32, 256, 64, "Converting image")
If CreateGadgetList(PopUpWindowID())
TextGadget(2, 16, 28, 80, 20, format+" --> Bmp")
ProgressBarGadget(3, 16, 48, 80, 32, 0, 100)
SetGadgetState(3, done)
EndIf
EndIf
Repeat
If ProgressExitCode = 1
done = 100
Else
done = Round((Seeker/BmpSize)*100, 0)
SetGadgetState(3, done)
Sleep_(20)
EndIf
Until done = 100
ClosePopUpWindow(2)
EndProcedure
Any ideas are welcome (come back, Fred! XD),
Bye,
El_Choni