##// END OF EJS Templates
Make sure containers transmit the children; take care of case where children is possibly empty.
Jason Grout -
Show More
@@ -219,7 +219,7 class BaseWidget(LoggingConfigurable):
219 219 # up encoding
220 220 if isinstance(value, BaseWidget):
221 221 value = value.comm.comm_id
222 elif isinstance(value, list) and isinstance(value[0], BaseWidget):
222 elif isinstance(value, list) and len(value)>0 and isinstance(value[0], BaseWidget):
223 223 # assume all elements of the list are widgets
224 224 value = [i.comm.comm_id for i in value]
225 225 state[k] = value
@@ -23,13 +23,14 class ContainerWidget(Widget):
23 23 target_name = Unicode('ContainerWidgetModel')
24 24 default_view_name = Unicode('ContainerView')
25 25
26 children = [] #List(Instance('IPython.html.widgets.widget.Widget'))
27
28 26 # Keys, all private and managed by helper methods. Flexible box model
29 27 # classes...
30 28 _keys = ['_vbox', '_hbox', '_align_start', '_align_end', '_align_center',
31 29 '_pack_start', '_pack_end', '_pack_center', '_flex0', '_flex1',
32 '_flex2', 'description', 'button_text']
30 '_flex2', 'description', 'button_text',
31 'children']
32 children = List(Instance(Widget))
33
33 34 description = Unicode()
34 35 button_text = Unicode()
35 36 _hbox = Bool(False)
@@ -25,11 +25,11 class MulticontainerWidget(Widget):
25 25 default_view_name = Unicode('TabView')
26 26
27 27 # Keys
28 _keys = ['_titles', 'selected_index']
28 _keys = ['_titles', 'selected_index', 'children']
29 29 _titles = Dict(help="Titles of the pages")
30 30 selected_index = Int(0)
31 31
32 children = [] #List(Instance('IPython.html.widgets.widget.Widget'))
32 children = List(Instance(Widget))
33 33
34 34 # Public methods
35 35 def set_title(self, index, title):
General Comments 0
You need to be logged in to leave comments. Login now