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