Question

In the traitsui documentation it states that

Blockquote A panel is very similar to a window, except that it is embedded in a larger window, which need not be a Traits UI window.

Does anyone know how to make a larger window and populate it with the edit_traits(kind='subpanel') UI objects from a couple traited objects? I found an example of doing this in a wx window here http://gael-varoquaux.info/computers/traits_tutorial/slides_Traits_en.pdf on slide 23, is there a way to do this that does not tie me to wxPython?

An answer here will likely also answer a similar question (TraitsUI, sharing an object)

Was it helpful?

Solution

Doing this always ties you to a GUI toolkit. That's the point: to embed the Traits UI panel into a larger, non-Traits GUI application that uses the desired GUI toolkit directly. The details outside of Traits are dependent on the GUI toolkit, naturally. If you aren't building a larger application that directly uses the GUI toolkit, you can ignore this functionality.

Are you instead asking how to build a Traits UI that happens to embed the full traits_view of another instance? In that case, you want to use a InstanceEditor with style="custom". Here is the code from the example in the linked documentation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top