question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ToggleButtons description width doesn't change with `style` kwarg

See original GitHub issue

Following 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:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
hinnefe2commented, Sep 12, 2017

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

0reactions
jasongroutcommented, Sep 14, 2017

Fixed by #1714.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found