jupyter-widgets / ipywidgets

Interactive Widgets for the Jupyter Notebook
https://ipywidgets.readthedocs.io
BSD 3-Clause "New" or "Revised" License
3.15k stars 950 forks source link

Create Widgets based on the Values of SelectMultiple #2551

Open moradza opened 5 years ago

moradza commented 5 years ago

I am using tabs and in my second tab, I have multiple-select options. Based on user selection, I want to open as many as user selected floatslider with entries named equal to user selection. I also want to have access to the users latest selections.

Example, self.SelectWidget =widgets.SelectMultiple( options=['A', 'B', 'C', 'D', 'F'], value=['A'], description='Select', disabled=False ) self.selection = latest(self.SelectWidget.value)

Prediction_Box= widgets.VBox([widgets.BoundedFloatText(value=0.0,min=0,max=1.0,step=0.0001,description=name,disabled=False, style=style) for name in self.selection ])

Thanks for your help.

pbugnion commented 4 years ago

Thanks for raising this.

I would look into observing a change in value traitlet of self.SelectWidget. Based on this, you could change the children traitlet of Prediction_Box.