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.

Make modifying layout easier

See original GitHub issue

Currently it’s not very convenient to change something in a widget layout, especially if you need to change several properties, for example:

w = Button()
w.layout.width = '100px'
w.layout.height = '50px'

It could look much better:

w = Button().with_layout(width='100px', height='50px')

Personally I now use dumb monkey-patching for this:

def _with_layout(self, **kwargs):
    for k, v in kwargs.items():
        setattr(self.layout, k, v)
    return self

iw.DOMWidget.with_layout = _with_layout

and would really like to see something like this in ipywidgets!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jasongroutcommented, Nov 16, 2016

@gwvr - thanks for bringing this up. This is a separate request from the one on this issue, so I’ve opened a new issue for your comment. Can we continue discussion there? #910.

0reactions
jasongroutcommented, Dec 9, 2016

Fixed by #961.

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 simple tips to making responsive layouts the easy way
FREE COURSE: Conquering Responsive Layouts https://courses.kevinpowell.co/conquering-responsive- layouts Links ✓ min(), max(), ...
Read more >
Google Slides: Editing Master Slides and Layouts - GCF Global
Customizing slide layouts​​ You can use the master template editor to modify any slide layout in your presentation. It's easy to make small...
Read more >
Edit and re-apply a slide layout - Microsoft Support
Change an existing layout · On the View tab, click Slide Master. · In the thumbnail pane that contains the slide masters and...
Read more >
Changing layout is difficult or easy in LaTeX? - TeX
Well, the design of a good layout takes time and more importantly skill. Just switching layouts usually is easy, even though there might...
Read more >
Simple Edit Layout - Squiz Matrix 5 Documentation
The Simple Edit Layout asset allows you to customise the layout of the fields in the Simple Edit Interface. Each Simple Edit Layout...
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