bugfix
This commit is contained in:
parent
77766589f9
commit
c4b29927e9
@ -18,15 +18,9 @@ from ..widget_css import WidgetCSS
|
|||||||
|
|
||||||
class BoolInput(Switch):
|
class BoolInput(Switch):
|
||||||
def __init__(self,csscls='input', **kw):
|
def __init__(self,csscls='input', **kw):
|
||||||
a = DictObject()
|
a = {}
|
||||||
if kw.get('defaultvalue',None) is None:
|
a['active'] = kw.get('value', kw.get('defaultvalue',False))
|
||||||
a.active = False
|
super().__init__(**a)
|
||||||
else:
|
|
||||||
a.active = kw.get('defaultvalue')
|
|
||||||
if kw.get('value',None) is not None:
|
|
||||||
a.active = kw.get('value')
|
|
||||||
|
|
||||||
super().__init__(**a.to_dict())
|
|
||||||
self.register_event_type('on_changed')
|
self.register_event_type('on_changed')
|
||||||
self.bind(active=on_active)
|
self.bind(active=on_active)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user