enthought / traits-enaml

A library to facilitate interoperation of Traits with Enaml > 0.8.x
Other
15 stars 11 forks source link

Automatically generate views for HasTraits objects #4

Closed jwiggins closed 11 years ago

jwiggins commented 11 years ago

This is still incomplete, but I think it shows what's possible.

(I also fixed setup.py since it had the wrong URL for the project)

corranwebster commented 11 years ago

Interesting - I'd assumed that you'd implemented this on the Python/Traits side rather than the Enaml side. This is pretty clean, though.

jwiggins commented 11 years ago

I'm not aware of a way to hook up notifications via the Python interface. Do you know a way?

jwiggins commented 11 years ago

Okie dokie. Now that I've added the DefaultEditor I'm pretty happy with this.

corranwebster commented 11 years ago

In terms of the notifications, I hadn't thought hard about it, but we don't need to mimic the full notification operator system, rather you just need to know how to sync up a Trait with an Atom on the underlying object (basically hook up appropriate handlers for each system which push changes with appropriate care to avoid loopback).

A 50-50 option would be to have the editors written in Enaml, using the Enaml notification to handle synchronisation, but generate the Windows, Containers, Forms, Labels, etc programatically from Python, rather than using a looper.

In any case, that's not needed if things work this way just fine.

jwiggins commented 11 years ago

I believe that covers everything now.

corranwebster commented 11 years ago

BTW, I'm tempted to merge this in the next day or so, since it's a needed feature and I'll take that over something perfect any day.

jwiggins commented 11 years ago

Please do. Easy extensibility can be covered by a future PR.