[Twisted-Python] Twisted and wxPython on windows
Uwe C. Schroeder
uwe at oss4u.com
Tue Mar 11 12:46:23 EST 2003
On Tuesday 11 March 2003 06:27 am, Ivo van der Wijk wrote:
> Hi all,
> I'm currently testing my python/twisted/wxWindows application under Win98
> (development is done under Linux).
> Has anyone tested this before?
> The application is rather unresponsive sometimes, even with the
> win32evenreactor installed.
> Does anyone know if things will perform better under win2k?
> I avoid touching Windows as much as possible, so I'm somewhat of a
> newbie in this area (windows development and python under windows).
The basic problem with wxPython and Twisted is the wxpython internal event
loop. If you follow the demos and docs of Twisted (using wxsupport) your app
will freeze whenever you open a menu or a modal dialogbox. This is due to the
fact that wxWindows uses a different eventloop to handle this type of events.
The wx main eventloop will suspend until the menu etc. closes.
Using wxsupport this will also freeze the twisted eventloop.
Ergo - nothing works until you close whatever popped up.
I posted a recipe in the Python Cookbook (activestate.com) a while ago.
Basically I solved the problem by running the normal wx eventloop and using
timers to run the twisted events. just check it out. It's only tested on
linux but maybe it helps you.
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