visual proxy in wxPython

Hi All,

I'm cross-posting this to the wxPython and Kiwi mailing lists, because it's relevant to both groups. Apologies to the Kiwi-people if it's more to do with wxPython.

Here's my question in short and long form:

Short version:
Does anyone know of a visual proxy implementation for wxPython?

Long version:
I've been working for some time on a wxPython application which uses the MVP pattern described here:
http://wiki.wxpython.org/wxPython_Patterns

I often needed to develop create/update/edit/delete GUIs for objects (or lists/dicts of them), and ended up with a little framework for making these forms. You basically provide it with a list of objects of the same type, and provide it with a list of attribute name and types, and it will generate a GUI so users can add/edit/delete entries on a list.

It's worked reasonably well so far, but the code's a bit messy now.. and in general, my MVP application isn't as clean/understandable as I'd hoped. Just having all these views, presenters, models and interactors for every single form seems a bit more complex than it needs to be.

A little while ago I came across this article on the Visual Proxy pattern, and how you can use it to make model classes that know how to generate their own GUI. It's a bit of a lengthy article, and it's geared towards Java Swing programs, but I think the idea itself is rather cool:
http://www.javaworld.com/javaworld/jw-09-1999/jw-09-toolbox.html

I did a bit of Googling, and found Kiwi. It's a PyGTK implementation of that idea, and it looks wonderful. Have a look at how in this example, there's no GUI widget related code at all. Fantastic!
http://www.async.com.br/projects/kiwi/example-personalinformation.html

I need to stick with wxPython because my application is well and truly underway (and I like wxPython's true native GUI underneath, no QT licensing issues for commercial apps etc.)

To the Kiwi developers:
- Do you think it's feasible to create a "wxPython backend" for Kiwi? Or is it too intertwined with PyGTK?

To the wxPython developers:
- Are there any wxPython implementations of this Visual Proxy idea out there? Would anyone be interested in seeing an open source one created? I could clean up my MVP-based framework and use that as a starting point.

Thanks to both camps for fantastic frameworks!

Robert

I'm cross-posting this to the wxPython and Kiwi mailing lists,
because it's relevant to both groups. Apologies to the Kiwi-people if
it's more to do with wxPython.

Thanks for your message -- sorry for taking a bit to answer, as email
continues to eat up major portions of my time.

Short version:
Does anyone know of a visual proxy implementation for wxPython?

Nope.

A little while ago I came across this article on the Visual Proxy
pattern, and how you can use it to make model classes that know how
to generate their own GUI. It's a bit of a lengthy article, and it's
geared towards Java Swing programs, but I think the idea itself is
rather cool:
http://www.javaworld.com/javaworld/jw-09-1999/jw-09-toolbox.html

I did a bit of Googling, and found Kiwi. It's a PyGTK implementation
of that idea, and it looks wonderful. Have a look at how in this
example, there's no GUI widget related code at all. Fantastic!
http://www.async.com.br/projects/kiwi/example-personalinformation.html

Yeah, it's pretty neat. There are a few things we could do to make it
even briefer:

    - Having a dictionary that mapped attributes to validation
      constraints and error messages.

    - Having a way to tie sensitivity of the button to the validation
      status of the interface automatically.

    - Not needing to specify all the attributes you want to proxy back
      and forth (though this has pros and cons).

I need to stick with wxPython because my application is well and
truly underway (and I like wxPython's true native GUI underneath, no
QT licensing issues for commercial apps etc.)

To the Kiwi developers:
- Do you think it's feasible to create a "wxPython backend" for Kiwi?
Or is it too intertwined with PyGTK?

It would probably be feasible, though some work. You would need to
provide your own Delegate classes, and find a way to hook up the signals
that Proxy needs with what wxPython provides (I'm not sure how signals
work in wx, but I'm pretty sure you have the signals we need). One thing
that is of some concern is that Kiwi2 uses custom signals (the validate
signal, for instance) that I'm not sure wxPython provides, at least not
in the way that gobject does. If you do some investigation of the code
you will come up with more specific questions that I'd be happy to
answer.

Good luck. Thanks for the compliments!

ยทยทยท

On Fri, Feb 08, 2008 at 04:34:13PM +0900, Robert Gravina wrote:
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3376 0125