I have a small plotting program implemented in python using TraitsUI as graphical interface (and matplotlib for plotting, but this is not important here). So I have a class Plotter(HasTraits)
, which is finally shown using the configure_traits()
method. The view
looks like this, with the actual maplotlib figure editor and some control elements:
view = View(Item('figure', editor=MPLFigureEditor(), show_label=False),
Item('param', show_label=False),
Group(Item('previous', show_label=False),
Item('next', show_label=False),
Item('xminbox', label="xrange"),
Item('xmaxbox', show_label=False),
Item('persistbox', label='persistent'),
orientation = 'horizontal'),
width=800,
height=600,
resizable=True,
title="TraitsVisualizer",)
Now I would like to add an additional "array" of checkboxes to the controls, with the actual number of checkboxes determined dynamically by the number of plots in the figure. So in my thoughts, I would need some way to add and remove "Items" from the view dynamically, but I cannot figure out how to achieve this.
Thanks!