I am making a UI which involves embedding a Mayavi view in a wx frame with controls, and I'm running into some problems. To strip down the issue, I've put together a working script which is a combination of their wx embedding and red ball picker examples; my project is a more sophisticated version of this.
I have two questions:
- If the user selects a different number of balls, I'd like to clear the figure and re-draw with a new set of balls. However, from what I've gathered from googling, I'd need to reset the picker after the clf() call. The similar examples I've seen use the @on_trait_change decorator for the scene.activated trait, but I'm not sure how to do this when the scene is not activated, but merely updated.
- If the user selects a different ball color, I'd like to simply change the color in-place without re-creating the scene. It appears that I can do so by using the set method of the glyph's mlab_source, and I imagine that it would be best to call this using @on_trait_change. However, I don't know how to best connect the wx triggering event to a trait type that allows for @on_trait_change to be fired.
Thanks in advance.
P.S. I wanted to post this instead at the enthought mailing list but the site appears to be down and has been for some time. Anyone noticed the same?