diff --git a/frame.py b/frame.py index d7dbd26..be2578a 100644 --- a/frame.py +++ b/frame.py @@ -49,11 +49,16 @@ class Frame: self.btn_close.on_click(*args, **kwargs) def do_click_cfg(self): + toggle_button_type(self.btn_cfg, "default", "warning") self.inner.visible = False switch_visibility(self.plt.fig, self.cfg_dialog) self.inner.visible = True + +def toggle_button_type(btn, type1, type2): + btn.button_type = type2 if btn.button_type == type1 else type1 + def switch_visibility(a, b): a.visible, b.visible = b.visible, a.visible