From 2f2d4788d7f501e76f3b86bec0ad732dc2387433 Mon Sep 17 00:00:00 2001 From: emkael Date: Sat, 16 Nov 2019 14:45:37 +0100 Subject: Fixing checkbox behaviour/value storage for boolean variables --- jfr_playoff/gui/variables.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'jfr_playoff/gui/variables.py') diff --git a/jfr_playoff/gui/variables.py b/jfr_playoff/gui/variables.py index 9dcbff2..7e6989c 100644 --- a/jfr_playoff/gui/variables.py +++ b/jfr_playoff/gui/variables.py @@ -26,6 +26,11 @@ class NotifyStringVar(NotifyVar, tk.StringVar): class NotifyIntVar(NotifyVar, tk.IntVar): pass +class NotifyBoolVar(NotifyVar, tk.StringVar): + def get(self, *args, **kwargs): + value = tk.StringVar.get(self, *args, **kwargs) + return int(value == '1') + class NotifyNumericVar(NumericVar, NotifyVar): def __init__(self, *args, **kwargs): NotifyVar.__init__(self, *args, **kwargs) -- cgit v1.2.3