summaryrefslogtreecommitdiff
path: root/jfr_playoff/gui/frames/visual.py
diff options
context:
space:
mode:
Diffstat (limited to 'jfr_playoff/gui/frames/visual.py')
-rw-r--r--jfr_playoff/gui/frames/visual.py26
1 files changed, 9 insertions, 17 deletions
diff --git a/jfr_playoff/gui/frames/visual.py b/jfr_playoff/gui/frames/visual.py
index ecc6e03..375025d 100644
--- a/jfr_playoff/gui/frames/visual.py
+++ b/jfr_playoff/gui/frames/visual.py
@@ -185,23 +185,15 @@ class MatchList(RefreshableOptionMenu):
self.winfo_toplevel().bind(
'<<MatchListChanged>>', self.refreshOptions, add='+')
self.configure(width=10)
- self._variable.trace('w', self._valueSet)
- self._valueLock = False
-
- def getOptions(self):
- return [match.label for match in self.winfo_toplevel().getMatches()]
-
- def _valueSet(self, *args):
- if not self._valueLock:
- self._valueLock = True
- value = getIntVal(self._variable, 0)
- for match in self.winfo_toplevel().getMatches():
- if match.id == value:
- self._variable.set(match.label)
- self._valueLock = False
- return
- self._variable.set('')
- self._valueLock = False
+
+ def getLabel(self, match):
+ return match.label
+
+ def getValues(self):
+ return self.winfo_toplevel().getMatches()
+
+ def cmpValue(self, match):
+ return match.id == getIntVal(self._variable, 0)
class BoxPositionFrame(RepeatableFrame):