summaryrefslogtreecommitdiff
path: root/jfr_playoff/gui/frames/visual.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-06-27 14:26:47 +0200
committeremkael <emkael@tlen.pl>2019-06-27 14:26:47 +0200
commit07ff0371f6cd1434fc3fdf11181954967a9d888b (patch)
tree2c577360c945515bec89dda7518d87f413b9c318 /jfr_playoff/gui/frames/visual.py
parent106133121d017c1788cde11c2d419b74e5465979 (diff)
Setting values for MatchList/TeamList unified
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):