ToggleButtons description width doesn't change with `style` kwarg
See original GitHub issueFollowing the docs here I’m trying to change the width of the description of a ToggleButtons by passing in a style kwarg. This works for an IntSlider as in the docs, but not for a ToggleButtons.
If someone can point me towards the relevant parts of IntSlider and ToggleButtons I’m happy to tag a stab at fixing this myself.
MWE:
from ipywidgets import IntSlider, ToggleButtons
from IPython.display import display
style = {'description_width': 'initial'}
# description reads 'A too long ...'
display(IntSlider(description='A too long description'))
# description reads 'A too long description'
display(IntSlider(description='A too long description', style=style))
# description reads 'A too long ...'
display(ToggleButtons(description='A too long description', options=['a','b'], style=style))
Versions:
{'commit_hash': 'd86648c5d',
'commit_source': 'installation',
'default_encoding': 'UTF-8',
'ipython_path': '/Users/hhinnefeld/miniconda3/lib/python3.5/site-packages/IPython',
'ipython_version': '6.1.0',
'os_name': 'posix',
'platform': 'Darwin-16.6.0-x86_64-i386-64bit',
'sys_executable': '/Users/hhinnefeld/miniconda3/bin/python',
'sys_platform': 'darwin',
'sys_version': '3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, '
'17:52:12) \n'
'[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)]'}
ipykernel==4.6.1
ipython==6.1.0
ipython-genutils==0.2.0
ipywidgets==7.0.0
jupyter-client==5.1.0
jupyter-console==5.1.0
jupyter-core==4.3.0
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Kivy ToggleButtons did not adjust according to different ...
I think the easiest fix is to use size_hint . Try changing your CustomLabel and CustomTogglebutton definitions in your kv to:
Read more >ipywidgets Documentation
You can change both by adjusting the description width and the widget width using the widget's style. [4]: style = {'description_width': ' ...
Read more >Widgets — Kivy 2.1.0 documentation
Setting size_hint to (0.5, 0.8), for example, will make the widget 50% the width and 80% the height of available size for the...
Read more >plotly.graph_objects.Layout — 5.11.0 documentation
Using convert types a numeric string in trace data may be treated as a number during automatic axis type detection. This is the...
Read more >font-size - CSS: Cascading Style Sheets - MDN Web Docs
Changing the font size also updates the sizes of the font ... the em unit was derived from the width of a capital...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hey yeah, sorry to leave it hanging, I’ll have a go at it tonight.
Fixed by #1714.