title: ipywidgets dynamic creation of checkboxes and selection of data
body: <p>I want to create a list of checkboxes so users can select from a list of data. I've created checkboxes for each piece of data and I'd now like the ticking of these checkboxes to add data to a list.</p>
  
  <pre class="lang-py prettyprint-override"><code>import ipywidgets as widgets
  
  data = ["data1", "data2", "data3", "data4"]
  
  selected_data = []
  
  checkboxes = [widgets.Checkbox(value=False, description=label) for label in data]
  
  widgets.VBox(children=checkboxes)
  </code></pre>
  
  <p>I'd like to do something along the lines of</p>
  
  <pre class="lang-py prettyprint-override"><code>def add_to_selected(d):
      selected_data.append(d)
  
  checkboxes[0].observe(add_to_selected)
  </code></pre>
  
  <p>Where this would add a value to the <code>selected_data</code> list. I don't know how to get the checkboxes in the VBox to behave like this.</p>