[Twisted-Python] PythonCard GUI client for pbecho example

Stephen Waterbury golux at comcast.net
Wed Apr 14 08:05:21 MDT 2004


Here is a better version -- thanks to contributions by
Kevin Altis.

* A status bar is used to show "Connected"
* Send can be triggered by <RETURN> or Send button
* Text field clears after sending
  (text area continues to accumulate echoed text, as before)

Stephen C. Waterbury wrote:
> Here's a PythonCard client that works with the pbecho.py
> server (I included pbecho.py so it's a self-contained example,
> but it's the same pbecho.py as in Twisted/doc/examples).
> 
> Dependencies:  PythonCard (http://pythoncard.sourceforge.net)
>                (requires wxPython)
> 
> Basically, all the logic of tpcpbechoclient was copied directly
> from pbechoclient.py -- the only functional difference is the
> capability to repeat the "Send" function.
> 
> It's pretty self-explanatory, but anyway:
> 
> * start up server:  python pbecho.py
> * start up client:  python tpcpbechoclient.py
> * when client comes up, click "Login" button
>   -> "CONNECTED" should appear on lower right side of panel
>      (meaning the client received a perspective)
> * enter something into the text field at the bottom
> * click "Send" button
>   -> the text should be echoed in the text area widget above
> 
> (Note:  if you have PythonCard installed as PythonCardPrototype,
> either change the name of your installation to PythonCard or
> do the substitution in my example code.  PythonCard is about to
> undergo the name change in its next released version.  If you use
> the CVS version, it's already re-named.)
> 
> Enjoy!
> - Steve
> 
> P.S.  Itamar:  I couldn't get the wxreactor to work with PythonCard;
> kept getting "AssertionError: reactor already installed", although
> I followed the directions in wxreactor's docstring.  I tried various
> permutations but finally got tired of messing with it ...
> let me know if have time to play with it and find a way that works!
> 
> For now, I'm using my "twistedpythoncard" module, which encapsulates
> Uwe's timer recipe so the rest of the code can use normal Twisted
> and PythonCard idioms.  That seems to work pretty well, but I will
> be trying some more non-trivial examples before I declare success.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tpcpbecho.zip
Type: application/zip
Size: 3660 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20040414/f0c39df7/attachment-0002.zip>


More information about the Twisted-Python mailing list