Update widget basics with some information about the placeholder

This commit is contained in:
Jessica B. Hamrick 2014-04-17 11:06:43 -04:00
parent 95fc7167dd
commit 4818549bb4

View File

@ -7,7 +7,7 @@
]
],
"name": "",
"signature": "sha256:9a70b52f0b16861d1cd6a8342b233247958977a52bde8d3efd69d21131ce1926"
"signature": "sha256:5ac3a85c8bb2f9bb3cd63b524bbb626ab1531176b43a109d13f5d7794f805eee"
},
"nbformat": 3,
"nbformat_minor": 0,
@ -31,7 +31,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 1
"prompt_number": 2
},
{
"cell_type": "heading",
@ -298,6 +298,39 @@
}
],
"prompt_number": 10
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Some widgets have special attributes. For example, text boxes and text areas can specify the `placeholder` attribute, which will set \"placeholder\" text to be displayed before the user has typed anything:"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"mytextwidget = widgets.TextWidget()\n",
"mytextwidget.placeholder = \"type something here\"\n",
"display(mytextwidget)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 4
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"mytextareawidget = widgets.TextareaWidget()\n",
"mytextareawidget.placeholder = \"your text here\"\n",
"display(mytextareawidget)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 5
}
],
"metadata": {}