Skip to content

Commit

Permalink
Delete the docs for the on_submit method.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasongrout committed Jul 27, 2017
1 parent 7d53455 commit de5a548
Showing 1 changed file with 8 additions and 44 deletions.
52 changes: 8 additions & 44 deletions docs/source/examples/Widget Events.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -124,63 +124,27 @@
}
},
"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."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"name": "stdout",
Expand Down

0 comments on commit de5a548

Please sign in to comment.