Re: [Enthought-Dev] [Chaco-users] Refreshing a DropBox

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [Enthought-Dev] [Chaco-users] Refreshing a DropBox

Peter Wang
(This actually is not really a Chaco question, and is more of a traits  
question.  Thus, I'm cross-posting my reply to enthought-dev.)

On Jan 19, 2010, at 3:28 PM, Christian Quaia wrote:

> Hello.
>
> I've created a Chaco UI with a couple of DropBox widgets (by adding
> two Enum traits to the View). What I would like to do is to update  
> the list
> of values in the second list as a function of the element selected  
> in the
> first list, but I can't find a way of doing it.
> I ended up looking at the traits code, and if I understand correctly  
> I would
> need to change the values and default_value fields in the Enum object.
> However, I cannot manage to get a handle to the trait object (which I
> defined at the class level)
>
> Any suggestion? Would adding the trait at the object level through
> add_trait make things any easier?

The attached code snippet is a small, self-contained example of how to  
drive one Enum from another.

-Peter




_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

two_enums.py (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Enthought-Dev] [Chaco-users] Refreshing a DropBox

bryce hendrix-2
Peter Wang wrote:

> (This actually is not really a Chaco question, and is more of a traits
> question.  Thus, I'm cross-posting my reply to enthought-dev.)
>
> On Jan 19, 2010, at 3:28 PM, Christian Quaia wrote:
>
>> Hello.
>>
>> I've created a Chaco UI with a couple of DropBox widgets (by adding
>> two Enum traits to the View). What I would like to do is to update
>> the list
>> of values in the second list as a function of the element selected in
>> the
>> first list, but I can't find a way of doing it.
>> I ended up looking at the traits code, and if I understand correctly
>> I would
>> need to change the values and default_value fields in the Enum object.
>> However, I cannot manage to get a handle to the trait object (which I
>> defined at the class level)
>>
>> Any suggestion? Would adding the trait at the object level through
>> add_trait make things any easier?
>
>
> The attached code snippet is a small, self-contained example of how to
> drive one Enum from another.

There is also an example on the Wiki:

https://svn.enthought.com/enthought/wiki/DependentEnumView

Bryce
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev