[wxPython-users] pubsub from threads
Frank Aune
Frank.Aune at broadpark.no
Tue Jan 15 05:02:41 PST 2008
On Tuesday 15 January 2008 13:09:31 Jorgen Bodde wrote:
> You cannot use pubsub because you will call your main gui in the
> thread context of your worker thread. Which is basically the same as
> just calling GUI elements from inside your thread. I would suggest
> using a thread safe QUEUE where you post data in, and use OnIdle or
> any other mechanism to read messages back inside the GUI thread. Also
> postevent will work, but then you will use GUI related stuff in a
> working thread and it's not really decoupled.
>
Thanks for the reply - I was afraid of this. IMHO this is a huge limitation
for pubsub.
Can the issue be worked around by calling wx.CallAfter on all functions
updating the GUI? I'm using this solution now, and it seems to be working,
however from experience such features can blow up in your face after some
time.
Cheers,
Frank
More information about the wxpython-users
mailing list