From 03da57b06ee2dad38d9c452865ac8e147401fe5d 2014-02-23 19:31:39 From: zah Date: 2014-02-23 19:31:39 Subject: [PATCH] Children fire event Now when a container widget is displayed, the _handle_displayed method of each of its children is fired. --- diff --git a/IPython/html/widgets/widget_container.py b/IPython/html/widgets/widget_container.py index ddfccd5..251aa78 100644 --- a/IPython/html/widgets/widget_container.py +++ b/IPython/html/widgets/widget_container.py @@ -27,6 +27,15 @@ class ContainerWidget(DOMWidget): children = List(Instance(DOMWidget)) _children = List(Instance(DOMWidget), sync=True) + + def __init__(self, **kwargs): + super(ContainerWidget, self).__init__(**kwargs) + self.on_displayed(ContainerWidget._fire_children_displayed) + + def _fire_children_displayed(self): + for child in self._children: + child._handle_displayed() + def _children_changed(self, name, old, new): """Validate children list.