SetGadgetText() indise a thread not allowed?

Just starting out? Need help? Post your questions and find answers here.
Lebostein
Addict
Addict
Posts: 807
Joined: Fri Jun 11, 2004 7:07 am

SetGadgetText() indise a thread not allowed?

Post by Lebostein »

I have simple download thread. To show the progress a ProgressBarGadget is updated from inside the thread during the process (SetGadgetState). If I show the progress additionaly with a text on a TextGadget, then the program crahses after a while (only if the Debugger is on). It is not alloewd to use SetGadgetText() inside a thread?
Rinzwind
Enthusiast
Enthusiast
Posts: 638
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: SetGadgetText() indise a thread not allowed?

Post by Rinzwind »

Never touch gui from threads. Use postevent to send updates to main gui thread and update it there.
Fred
Administrator
Administrator
Posts: 16686
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: SetGadgetText() indise a thread not allowed?

Post by Fred »

Exactly.
User avatar
mk-soft
Always Here
Always Here
Posts: 5406
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: SetGadgetText() indise a thread not allowed?

Post by mk-soft »

Show Module ThreadToGUI
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Lebostein
Addict
Addict
Posts: 807
Joined: Fri Jun 11, 2004 7:07 am

Re: SetGadgetText() indise a thread not allowed?

Post by Lebostein »

Thanks to all!
Post Reply