Skip to content

Commit c54974e

Browse files
authored
Merge pull request #2735 from adam-ah/master
Adding examples to the example doc how to change the size of the dropdown/radiobuttons
2 parents 1a7bc57 + b5d42bc commit c54974e

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

docs/source/examples/Widget List.ipynb

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,12 +537,42 @@
537537
"source": [
538538
"widgets.RadioButtons(\n",
539539
" options=['pepperoni', 'pineapple', 'anchovies'],\n",
540-
"# value='pineapple',\n",
540+
"# value='pineapple', # Defaults to 'pineapple'\n",
541+
"# layout={'width': 'max-content'}, # If the items' names are long\n",
541542
" description='Pizza topping:',\n",
542543
" disabled=False\n",
543544
")"
544545
]
545546
},
547+
{
548+
"cell_type": "markdown",
549+
"metadata": {},
550+
"source": [
551+
"#### With dynamic layout and very long labels"
552+
]
553+
},
554+
{
555+
"cell_type": "code",
556+
"execution_count": null,
557+
"metadata": {},
558+
"outputs": [],
559+
"source": [
560+
"widgets.Box(\n",
561+
" [\n",
562+
" widgets.Label(value='Pizza topping with a very long label:'), \n",
563+
" widgets.RadioButtons(\n",
564+
" options=[\n",
565+
" 'pepperoni', \n",
566+
" 'pineapple', \n",
567+
" 'anchovies', \n",
568+
" 'and the long name that will fit fine and the long name that will fit fine and the long name that will fit fine '\n",
569+
" ],\n",
570+
" layout={'width': 'max-content'}\n",
571+
" )\n",
572+
" ]\n",
573+
")"
574+
]
575+
},
546576
{
547577
"cell_type": "markdown",
548578
"metadata": {
@@ -1339,7 +1369,7 @@
13391369
"name": "python",
13401370
"nbconvert_exporter": "python",
13411371
"pygments_lexer": "ipython3",
1342-
"version": "3.6.4"
1372+
"version": "3.7.6"
13431373
}
13441374
},
13451375
"nbformat": 4,

0 commit comments

Comments
 (0)