Make Container widgets take children as the first positional argument

This makes creating containers less cumbersome: Container([list, of, children]), rather than Container(children=[list, of, children])
Jason Grout 12 years ago
parent 28884d4462
commit 14f3897b56

@ -17,7 +17,8 @@ class ContainerWidget(DOMWidget):
# When a proper notifying-list trait exists, that is what should be used here.
children = Tuple(sync=True)
def __init__(self, **kwargs):
def __init__(self, children = None, **kwargs):
kwargs['children'] = children
super(ContainerWidget, self).__init__(**kwargs)
self.on_displayed(ContainerWidget._fire_children_displayed)

Loading…
Cancel
Save