From c4b29927e9122df2466cc5a555079eb3511ecf8c Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 9 Jun 2021 10:27:43 +0800 Subject: [PATCH] bugfix --- kivyblocks/widgetExt/inputext.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/kivyblocks/widgetExt/inputext.py b/kivyblocks/widgetExt/inputext.py index 914ebc2..2d7f9ea 100755 --- a/kivyblocks/widgetExt/inputext.py +++ b/kivyblocks/widgetExt/inputext.py @@ -18,15 +18,9 @@ from ..widget_css import WidgetCSS class BoolInput(Switch): def __init__(self,csscls='input', **kw): - a = DictObject() - if kw.get('defaultvalue',None) is None: - a.active = False - else: - a.active = kw.get('defaultvalue') - if kw.get('value',None) is not None: - a.active = kw.get('value') - - super().__init__(**a.to_dict()) + a = {} + a['active'] = kw.get('value', kw.get('defaultvalue',False)) + super().__init__(**a) self.register_event_type('on_changed') self.bind(active=on_active)