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.

Add `titles` as a __init__ trait

See original GitHub issue

I find it quite unpythonic to have to write

tabs = w.Tab(children=outputs)
for i, title in enumerate(titles):
    tabs.set_title(i, title)

Where, we should just be able to write:

tabs = w.Tab(children=outputs, titles=titles)

Issue Analytics

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

github_iconTop GitHub Comments

5reactions
jasongroutcommented, May 17, 2019

Where, we should just be able to write:

tabs = w.Tab(children=outputs, titles=titles)

+1. It’s bothered me for a long time that we have get_title and set_title.

Additionally, looking at the code, it’s weird that titles is a dictionary indexed with integers, instead of just a tuple corresponding to the children. I think we could expose a tuple interface to users (along with constructor attribute) in a backwards-compatible way (i.e., changes to the tuple would change the dict that is synced), and we could eliminate the dict in 8.0.

0reactions
jasongroutcommented, Dec 7, 2020

Title assignment examples for Tab and Accordion from readthedocs are not working

@CatChenal - make sure you are looking at the stable docs for ipywidgets 7.x. The development docs are for ipywidgets 8.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trait Manager - GrapesJS
Add Traits to Components · Built-in trait types. Text; Number; Checkbox; Select; Color; Button · Updating traits at run-time · Define new Trait...
Read more >
How to initialize trait's vals in subtrait? - scala - Stack Overflow
I tried using an abstract val in a trait to initialize another value. I got a NullPointerException . I boiled the behaviour down...
Read more >
UITraitCollection | Apple Developer Documentation
The UITraitCollection class includes four specialized constructors as well as a constructor that lets you combine an array of trait collections, init(traitsFrom ...
Read more >
Introduction to Trait Editor Factories — TraitsUI 7 Documentation
A List trait can be edited by means of ListEditor, TableEditor (if the List elements are HasTraits objects), CheckListEditor or SetEditor.
Read more >
Traits | Larawiz Documentation - GitHub Pages
Just put the traits in a list below the uses key. These will be added to any existing trait of the model, and...
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