[Twisted-Python] GUI Integration

Hi all, I would like to integrate the PerspectiveBorker into a platform-independant GUI. If I use Delphi for example, I include the twisted-reactor via the Python Deplhi Interface. But then if I call "reactor.run()" this blocks the Delphi Application! Since wxPython for is not supported for Windows yet, and I do not want to use GTK or PyGui, my question is: How can I integrate the twisted framework into a GUI environment such as Delphi? Or do I have to use Java? Can I run the reactor in another thread? regards, Thorsten -- brainbot technologies AG boppstrasse . 64 . 55118 mainz . germany fon +49 6131 211639-1 . fax +49 6131 211639-2 http://brainbot.com/ mailto:henni@brainbot.com

On Wednesday 19 November 2003 12:59, Thorsten Henninger wrote:
Since wxPython for is not supported for Windows yet, and I do not want to use GTK or PyGui, my question is:
Where did you see that wxPython is not supported for windows ? it works perfect with windows ! Btw, you can find on this mailing list some examples about using twisted in wx apps. kind regards Philippe

Where did you see that wxPython is not supported for windows ? it works perfect with windows ! Btw, you can find on this mailing list some examples about using twisted in wx apps.
this is what happens, if you run the wxdemo on windows 2000: C:\Dokumente und Einstellungen\henni\Desktop>wxdemo.py D:\Python23\lib\fcntl.py:7: DeprecationWarning: the FCNTL module is deprecated; please use fcntl DeprecationWarning) D:\Python23\lib\site-packages\twisted\internet\wxsupport.py:69: UserWarning: Be advised wxsupport is not fully functional on Windows. warnings.warn("Be advised wxsupport is not fully functional on Windows.") Traceback (most recent call last): File "C:\Dokumente und Einstellungen\henni\Desktop\wxdemo.py", line 65, in ? demo() File "C:\Dokumente und Einstellungen\henni\Desktop\wxdemo.py", line 61, in demo reactor.run() File "D:\Python23\Lib\site-packages\twisted\internet\default.py", line 121, in run self.startRunning(installSignalHandlers=installSignalHandlers) File "D:\Python23\Lib\site-packages\twisted\internet\default.py", line 115, in startRunning self._handleSignals() File "D:\Python23\Lib\site-packages\twisted\internet\default.py", line 87, in _handleSignals signal.signal(signal.SIGINT, self.sigInt) SystemError: error return without exception set 13:45:14: Debug: c:\PROJECTS\wx\src\msw\app.cpp(439): 'UnregisterClass(canvas)' failed with error 0x00000584 (diese Klasse hat noch ge÷ffnete Fenster.). Of course, simulating the reactor via a wxTimer (as seen on ASPN) does work, but the latest twisted says, wxsupport is not fully supported on Windows. regards, Thorsten -- brainbot technologies AG boppstrasse . 64 . 55118 mainz . germany fon +49 6131 211639-1 . fax +49 6131 211639-2 http://brainbot.com/ mailto:henni@brainbot.com

ouch ! I haven't seen this demo, but I think it's quite old. try this instead : http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/203471 (your warning came from twisted, not wxpython) and here is the killing tip of the day : http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/181780 Hope it will help ! -- Philippe On Wednesday 19 November 2003 13:49, Thorsten Henninger wrote:
Where did you see that wxPython is not supported for windows ? it works perfect with windows ! Btw, you can find on this mailing list some examples about using twisted in wx apps.
this is what happens, if you run the wxdemo on windows 2000: C:\Dokumente und Einstellungen\henni\Desktop>wxdemo.py D:\Python23\lib\fcntl.py:7: DeprecationWarning: the FCNTL module is deprecated; please use fcntl DeprecationWarning) D:\Python23\lib\site-packages\twisted\internet\wxsupport.py:69: UserWarning: Be advised wxsupport is not fully functional on Windows. warnings.warn("Be advised wxsupport is not fully functional on Windows.") Traceback (most recent call last): File "C:\Dokumente und Einstellungen\henni\Desktop\wxdemo.py", line 65, in ? demo() File "C:\Dokumente und Einstellungen\henni\Desktop\wxdemo.py", line 61, in demo reactor.run() File "D:\Python23\Lib\site-packages\twisted\internet\default.py", line 121, in run self.startRunning(installSignalHandlers=installSignalHandlers) File "D:\Python23\Lib\site-packages\twisted\internet\default.py", line 115, in startRunning self._handleSignals() File "D:\Python23\Lib\site-packages\twisted\internet\default.py", line 87, in _handleSignals signal.signal(signal.SIGINT, self.sigInt) SystemError: error return without exception set 13:45:14: Debug: c:\PROJECTS\wx\src\msw\app.cpp(439): 'UnregisterClass(canvas)' failed with error 0x00000584 (diese Klasse hat noch ge÷ffnete Fenster.).
Of course, simulating the reactor via a wxTimer (as seen on ASPN) does work, but the latest twisted says, wxsupport is not fully supported on Windows.
regards,
Thorsten

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The wxsupport is broken, no matter which platform. That's why I invented the timer thing on ASPN. Wxsupport will fail the moment you open a modal dialog (or use a pulldown menu, which also is a modal). Probably there will never be a real reactor, well - unless someone with a lot of knowledge of both twisted and wxpython writes one. The problem is that wx - being platform independent uses the native event-loop, which behaves differently on windows, gtk or whatever. So a reactor would have to take care of that. The timer recipe works nicely though. UC On Wednesday 19 November 2003 04:49 am, Thorsten Henninger wrote:
Where did you see that wxPython is not supported for windows ? it works perfect with windows ! Btw, you can find on this mailing list some examples about using twisted in wx apps.
this is what happens, if you run the wxdemo on windows 2000: C:\Dokumente und Einstellungen\henni\Desktop>wxdemo.py D:\Python23\lib\fcntl.py:7: DeprecationWarning: the FCNTL module is deprecated; please use fcntl DeprecationWarning) D:\Python23\lib\site-packages\twisted\internet\wxsupport.py:69: UserWarning: Be advised wxsupport is not fully functional on Windows. warnings.warn("Be advised wxsupport is not fully functional on Windows.") Traceback (most recent call last): File "C:\Dokumente und Einstellungen\henni\Desktop\wxdemo.py", line 65, in ? demo() File "C:\Dokumente und Einstellungen\henni\Desktop\wxdemo.py", line 61, in demo reactor.run() File "D:\Python23\Lib\site-packages\twisted\internet\default.py", line 121, in run self.startRunning(installSignalHandlers=installSignalHandlers) File "D:\Python23\Lib\site-packages\twisted\internet\default.py", line 115, in startRunning self._handleSignals() File "D:\Python23\Lib\site-packages\twisted\internet\default.py", line 87, in _handleSignals signal.signal(signal.SIGINT, self.sigInt) SystemError: error return without exception set 13:45:14: Debug: c:\PROJECTS\wx\src\msw\app.cpp(439): 'UnregisterClass(canvas)' failed with error 0x00000584 (diese Klasse hat noch ge÷ffnete Fenster.).
Of course, simulating the reactor via a wxTimer (as seen on ASPN) does work, but the latest twisted says, wxsupport is not fully supported on Windows.
regards,
Thorsten
- -- 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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/wAvRjqGXBvRToM4RAnHAAJ4j1l1IhMVoZEF9CVrabf7QDaX5RQCfX7rB 1MZg9UNdRIARS3skbevb3tw= =Y5Ca -----END PGP SIGNATURE-----

What is the difference between twisted.internet.app.Application and twisted.application.service.Application? Thanks a lot. Yun

On Sun, 23 Nov 2003 16:42:07 -0500 (EST) Yun Mao <maoy@cis.upenn.edu> wrote:
What is the difference between
twisted.internet.app.Application
This is old and deprecated. Don't use it. Use the other (i.e. what the 1.1 documentation covers.) -- Itamar Shtull-Trauring http://itamarst.org/ Available for Python & Twisted consulting

On Wed, 19 Nov 2003 12:59:35 +0100 Thorsten Henninger <henni@brainbot.com> wrote:
If I use Delphi for example, I include the twisted-reactor via the Python Deplhi Interface. But then if I call "reactor.run()" this blocks the Delphi Application!
You want to integrate the Delphi event loop with the Twisted event loop. This will involve either a custom reactor, or something like what twisted.internet.wxsupport or tksupport do. -- Itamar Shtull-Trauring http://itamarst.org/ Available for Python & Twisted consulting
participants (5)
-
Itamar Shtull-Trauring
-
Philippe Lafoucrière
-
Thorsten Henninger
-
Uwe C. Schroeder
-
Yun Mao