diff --git a/docs/source/examples/Widget Events.ipynb b/docs/source/examples/Widget Events.ipynb index 8d1e96539da..93448d68833 100644 --- a/docs/source/examples/Widget Events.ipynb +++ b/docs/source/examples/Widget Events.ipynb @@ -124,55 +124,15 @@ } }, "source": [ - "### on_submit" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The `Text` widget also has a special `on_submit` event. The `on_submit` event fires when the user hits return." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "cab0a6538a00491f95c48e77707e9ad8" - } - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "text = widgets.Text()\n", - "display(text)\n", - "\n", - "def handle_submit(sender):\n", - " print(text.value)\n", - "\n", - "text.on_submit(handle_submit)" + "## Traitlet events" ] }, { "cell_type": "markdown", "metadata": { - "slideshow": { - "slide_type": "slide" - } + "deletable": true, + "editable": true }, - "source": [ - "## Traitlet events" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, "source": [ "Widget properties are IPython traitlets and traitlets are eventful. To handle changes, the `observe` method of the widget can be used to register a callback. The doc string for `observe` can be seen below." ] @@ -180,7 +140,11 @@ { "cell_type": "code", "execution_count": 5, - "metadata": {}, + "metadata": { + "collapsed": false, + "deletable": true, + "editable": true + }, "outputs": [ { "name": "stdout",