Skip to content

Commit

Permalink
re-export link and dlink from traitlets for consistency with the java…
Browse files Browse the repository at this point in the history
…script API
  • Loading branch information
rprimet committed Jan 23, 2018
1 parent 7626dc8 commit 69dda10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/source/examples/Widget Events.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
"caption = widgets.Label(value='The values of slider1 and slider2 are synchronized')\n",
"sliders1, slider2 = widgets.IntSlider(description='Slider 1'),\\\n",
" widgets.IntSlider(description='Slider 2')\n",
"l = traitlets.link((sliders1, 'value'), (slider2, 'value'))\n",
"l = widgets.link((sliders1, 'value'), (slider2, 'value'))\n",
"display(caption, sliders1, slider2)"
]
},
Expand Down Expand Up @@ -372,7 +372,7 @@
"caption = widgets.Label(value='Changes in source values are reflected in target1')\n",
"source, target1 = widgets.IntSlider(description='Source'),\\\n",
" widgets.IntSlider(description='Target 1')\n",
"dl = traitlets.dlink((source, 'value'), (target1, 'value'))\n",
"dl = widgets.dlink((source, 'value'), (target1, 'value'))\n",
"display(caption, source, target1)"
]
},
Expand Down Expand Up @@ -657,9 +657,9 @@
"c = widgets.IntSlider(description=\"Continuous\", continuous_update=True)\n",
"d = widgets.IntText(description=\"Continuous\", continuous_update=True)\n",
"\n",
"traitlets.link((a, 'value'), (b, 'value'))\n",
"traitlets.link((a, 'value'), (c, 'value'))\n",
"traitlets.link((a, 'value'), (d, 'value'))\n",
"widgets.link((a, 'value'), (b, 'value'))\n",
"widgets.link((a, 'value'), (c, 'value'))\n",
"widgets.link((a, 'value'), (d, 'value'))\n",
"widgets.VBox([a,b,c,d])"
]
},
Expand Down
1 change: 1 addition & 0 deletions ipywidgets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from IPython import get_ipython
from ._version import version_info, __version__, __protocol_version__, __jupyter_widgets_controls_version__, __jupyter_widgets_base_version__
from .widgets import *
from traitlets import link, dlink


def load_ipython_extension(ip):
Expand Down

0 comments on commit 69dda10

Please sign in to comment.