summaryrefslogtreecommitdiff
path: root/jfr_playoff/gui/variables.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-11-16 14:45:37 +0100
committeremkael <emkael@tlen.pl>2019-11-16 14:45:37 +0100
commit2f2d4788d7f501e76f3b86bec0ad732dc2387433 (patch)
treec01f5e20a9323cf229fe067547c356389765dc3b /jfr_playoff/gui/variables.py
parent10cab28b7e5280066cd6b4442d0d3ded11e812e6 (diff)
Fixing checkbox behaviour/value storage for boolean variables
Diffstat (limited to 'jfr_playoff/gui/variables.py')
-rw-r--r--jfr_playoff/gui/variables.py5
1 files changed, 5 insertions, 0 deletions
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)