wut-web-dev cruft input tests wtf

master
ml server 2020-01-23 19:26:07 -07:00
parent 7c9eb3cf32
commit 8ccbaab6ec
1 changed files with 19 additions and 0 deletions

View File

@ -48,6 +48,25 @@
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def on_click(btn):\n",
" n = int(btn.description)\n",
" btn.description = str(n+1)\n",
" \n",
"def test_button():\n",
" \"\"\"\n",
" Create button that displays number of times it was clicked\n",
" \"\"\"\n",
" btn = w.Button(description=\"0\")\n",
" btn.on_click(on_click)\n",
" return btn\n"
]
},
{
"cell_type": "code",
"execution_count": null,