[PEAK] Connecting the Trellis to non-trellis systems

Phillip J. Eby pje at telecommunity.com
Tue Mar 11 11:19:12 EDT 2008

At 09:50 AM 3/11/2008 +0200, Peter Damoc wrote:
>Hi Phillip,
>Are there any GUI examples? wxPython examples would be ideal. :)

Not yet, but there will be at some point.  Gotta finish, test, and 
document the code first!

However, I envision having something like an 
"EventConnector(wxobject, wxevent, defaultobject)" cell, whose 
subscribe/unsubscribe methods will simply call down to 
bind/unbind.  And then those connectors will be wrapped in APIs like 
'getMousePosition(wxobject)' that you'll be able to use in rules, to 
have the rule get recalculated when the mouse position changes.  Or 
like 'mouseDown(wxobject)', that goes true when a mouse down event occurs, etc.

My general idea is to make these either generic functions, or methods 
of a context.Service, so that you can write rules that are in fact 
not specific to the GUI backend in use.  That way, you could write 
code that's not only cross-platform, but would also work with Qt, wx, 
Tk, or any other unpronounceable pair of consonants that stands for a 
GUI framework.  ;-)

I'm pretty excited, though, about the part where we won't have to use 
those %$$&%%($ "bind" calls any more, or figure out how to 
reverse-map the GUI's events into our application's state 
machines.  Instead, we'll get to treat the GUI like a *library* 
instead of a framework.

Looks like the Trellis is going to be able to "untwist" more than 
just Twisted, in other words.

More information about the PEAK mailing list