##// END OF EJS Templates
Merge master
Merge master

File last commit:

r17266:a9dd34fc
r17684:d1de54f3 merge
Show More
widget_container.py
34 lines | 1.1 KiB | text/x-python | PythonLexer
Jonathan Frederic
Cleaned up Python widget code.
r14283 """ContainerWidget class.
Represents a container that can be used to group other widgets.
"""
Jonathan Frederic
Allow a widget to be displayed more than once within a parent widget.
r17172
# Copyright (c) IPython Development Team.
Jonathan Frederic
Cleaned up Python widget code.
r14283 # Distributed under the terms of the Modified BSD License.
Jonathan Frederic
s/Widget/DOMWidget s/BaseWidget/Widget
r14540 from .widget import DOMWidget
MinRK
don't validate ContainerWidget.children...
r15480 from IPython.utils.traitlets import Unicode, Tuple, TraitError
Jonathan Frederic
Add container widget
r14239
Jonathan Frederic
s/Widget/DOMWidget s/BaseWidget/Widget
r14540 class ContainerWidget(DOMWidget):
Jonathan Frederic
s/view_name/_view_name
r14701 _view_name = Unicode('ContainerView', sync=True)
Jonathan Frederic
Attempt 1, HBox and VBox implementation.
r14268
MinRK
don't validate ContainerWidget.children...
r15480 # Child widgets in the container.
# Using a tuple here to force reassignment to update the list.
# When a proper notifying-list trait exists, that is what should be used here.
Jason Grout
Container assumes the children attribute is not None...
r17266 children = Tuple(sync=True, allow_none=False)
zah
Children fire event...
r15446
Jason Grout
Container assumes the children attribute is not None...
r17266 def __init__(self, children = (), **kwargs):
Jason Grout
Make Container widgets take children as the first positional argument...
r17261 kwargs['children'] = children
zah
Children fire event...
r15446 super(ContainerWidget, self).__init__(**kwargs)
self.on_displayed(ContainerWidget._fire_children_displayed)
def _fire_children_displayed(self):
Jonathan Frederic
Fixed buggy behavior
r17173 for child in self.children:
zah
Children fire event...
r15446 child._handle_displayed()
Jonathan Frederic
More PEP8 changes
r14607
Jonathan Frederic
s/ModalView/PopupView
r14676 class PopupWidget(ContainerWidget):
Jonathan Frederic
s/view_name/_view_name
r14701 _view_name = Unicode('PopupView', sync=True)
Jonathan Frederic
containers and selectioncontainers now only allow one of any single child
r14608
description = Unicode(sync=True)
button_text = Unicode(sync=True)