diff options
Diffstat (limited to 'jfr_playoff/gui/variables.py')
-rw-r--r-- | jfr_playoff/gui/variables.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/jfr_playoff/gui/variables.py b/jfr_playoff/gui/variables.py index 8927179..e6877f2 100644 --- a/jfr_playoff/gui/variables.py +++ b/jfr_playoff/gui/variables.py @@ -13,15 +13,18 @@ class NotifyVar(tk.Variable): self._root.event_generate('<<ValueChanged>>', when='tail') self._prevValue = self.get() +class NumericVar(tk.StringVar): + def get(self, default=None): + try: + return int(str(tk.StringVar.get(self)).strip()) + except ValueError: + return default + class NotifyStringVar(NotifyVar, tk.StringVar): pass class NotifyIntVar(NotifyVar, tk.IntVar): pass -class NotifyNumericVar(NotifyStringVar): - def get(self, default=None): - try: - return int(str(NotifyStringVar.get(self)).strip()) - except ValueError: - return default +class NotifyNumericVar(NotifyVar, NumericVar): + pass |