Threads and Wx

I think its best-practice to always do all GUI stuff in the main thread; it may or may not work, but its not something you can rely on. I might be wrong.

Either way, why not just use wx.CallAfter instead of events in this situation?

wx.CallAfter(self.myfunction)

will invoke said function in the main thread when the current pending GUI events are done.

···

On 3/9/07, ** luisgustavo@petrobras.com.br** luisgustavo@petrobras.com.br wrote:

Dear Friends,

I use a thread on my wxpython program. It had a problem when the thread
tryed to make a big change on the main wx father thread. I solved this by
creating an event as explained in the doc thread example.

Now the child thread still makes updates in the father’s wx toolbar
directly, as it was already working before and I did not change. Is this
safe or should I create events for this minor updates?

thanks,

Luis


Stephen Hansen
Development
Advanced Prepress Technology

shansen@advpubtech.com
(818) 748-9282