[Twisted-Python] wxPython locking the event processing?
Uwe C. Schroeder
uwe at oss4u.com
Sat Jul 5 11:56:40 MDT 2003
On Saturday 05 July 2003 10:14 am, Itamar Shtull-Trauring wrote:
> On Sat, 5 Jul 2003 18:24:49 +0200
>
> "Patrik Blommaskog" <pb_twisted at olga.mine.nu> wrote:
> > Meanwhile, is there anything that I should be aware of considering
> > that we now have separate threads for wx and Twisted? Can I for
> > example use reactor.callLater() to call methods on wx objects, or work
> > with Perspectives, Cacheables, reactor etc from wx event handlers
> > without any problems?
>
> They will break horribly. So, use reactor.callFromThread to call twisted
> APIs from wx thread and the wx equivalent to call wx APIs from the
> twisted thread.
The wx equivalent should be wx.CallAfter, which will schedule the given
function in the (wx) mainthread. Even if you decide to use the unthreaded
recipe I posted on activestate, you will still have to call wx functions from
outside a twisted callback.
--
UC
--
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417
More information about the Twisted-Python
mailing list