Created
October 29, 2014 19:02
-
-
Save jdfreder/e37886fbc4b748ed807d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "metadata": { | |
| "name": "", | |
| "signature": "sha256:94b9967203eda1889600d6f747bf64693e9b744ad9cf4e80a942765578fccac2" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "collapsed": false, | |
| "input": [ | |
| "from IPython.html import widgets\n", | |
| "from IPython.display import display" | |
| ], | |
| "language": "python", | |
| "metadata": {}, | |
| "outputs": [], | |
| "prompt_number": 1 | |
| }, | |
| { | |
| "cell_type": "code", | |
| "collapsed": false, | |
| "input": [ | |
| "box = widgets.ContainerWidget()\n", | |
| "step1 = widgets.DropdownWidget(values=[a for a in 'abc.'])\n", | |
| "step2 = widgets.DropdownWidget(values=[a for a in 'abc.'], visible=False)\n", | |
| "step3 = widgets.DropdownWidget(values=[a for a in 'abc.'], visible=False)\n", | |
| "box.children = [step1, step2, step3]\n", | |
| "display(box)\n", | |
| "box.remove_class('vbox')\n", | |
| "box.add_class('hbox')\n" | |
| ], | |
| "language": "python", | |
| "metadata": {}, | |
| "outputs": [], | |
| "prompt_number": 10 | |
| }, | |
| { | |
| "cell_type": "code", | |
| "collapsed": false, | |
| "input": [ | |
| "def step1_change(name, old, new):\n", | |
| " step2.visible = new != '.'\n", | |
| "step1.on_trait_change(step1_change, 'value')" | |
| ], | |
| "language": "python", | |
| "metadata": {}, | |
| "outputs": [], | |
| "prompt_number": 11 | |
| }, | |
| { | |
| "cell_type": "code", | |
| "collapsed": false, | |
| "input": [], | |
| "language": "python", | |
| "metadata": {}, | |
| "outputs": [] | |
| } | |
| ], | |
| "metadata": {} | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment