##// END OF EJS Templates
widget registry
Sylvain Corlay -
Show More
@@ -75,12 +75,22 b' def _show_traceback(method):'
75 ip.showtraceback()
75 ip.showtraceback()
76 return m
76 return m
77
77
78
79 def register(key=None):
80 def wrap(widget):
81 l = key if key is not None else widget._model_name.default_value
82 Widget.widget_types[l] = widget
83 return widget
84 return wrap
85
86
78 class Widget(LoggingConfigurable):
87 class Widget(LoggingConfigurable):
79 #-------------------------------------------------------------------------
88 #-------------------------------------------------------------------------
80 # Class attributes
89 # Class attributes
81 #-------------------------------------------------------------------------
90 #-------------------------------------------------------------------------
82 _widget_construction_callback = None
91 _widget_construction_callback = None
83 widgets = {}
92 widgets = {}
93 widget_types = {}
84
94
85 @staticmethod
95 @staticmethod
86 def on_widget_constructed(callback):
96 def on_widget_constructed(callback):
General Comments 0
You need to be logged in to leave comments. Login now