jakevdp/ipywidgets — pull request #5 by mglerner (2014-03-30 01:06:50+00:00)
Title: I added DropDown widgets.

I had two issues when writing this:

1) As far as I know (I'm a JavaScript novice these days), there's no nice way to automatically loop over radio buttons, sliders and dropdowns. So, I used a function from http://stackoverflow.com/questions/914783/javascript-nodelist/17262552#17262552 to join two NodeLists.

2) If you have more than one widget, your output name is . But you build up your widget lists in two places (once in Python in StaticInteract._output_html, and once in JavaScript in interactUpdate). I ran into trouble where they would iterate through the widgets in different orders. I have a feeling I'm just doing something dumb, but I didn't see where. My workaround was to explicitly sort the list of widgets in alphabetical order. While I was at it, I made it show the widgets in alphabetical order as well. I don't know of any way to get them in the order they were declared, but I thought some defined order made the output easier to control.

I also updated the example IPython Notebook. In case it's troublesome: I'm using IPython 2.0, so the version updated.