summaryrefslogtreecommitdiff
path: root/jfr_playoff/gui/frames/match.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-06-27 20:44:23 +0200
committeremkael <emkael@tlen.pl>2019-06-27 20:44:23 +0200
commit69c0e0733b6c254e798bfd75569d80d220eb4a15 (patch)
treecb789c8f30d3082c2760b8bba0f5e64b4a2f77a3 /jfr_playoff/gui/frames/match.py
parent1b33aabd2d5949be3d94b23dfe54f4b28a8959a2 (diff)
SelectionButton/Frame with custom value mappings
Diffstat (limited to 'jfr_playoff/gui/frames/match.py')
-rw-r--r--jfr_playoff/gui/frames/match.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/jfr_playoff/gui/frames/match.py b/jfr_playoff/gui/frames/match.py
index aa06b8b..6487e23 100644
--- a/jfr_playoff/gui/frames/match.py
+++ b/jfr_playoff/gui/frames/match.py
@@ -192,13 +192,17 @@ class MatchSelectionButton(SelectionButton):
class MatchSelectionFrame(SelectionFrame):
def renderOption(self, container, option, idx):
- (ttk.Label(container, text='[%d]' % (idx+1))).grid(
- row=idx+1, column=0)
+ (ttk.Label(
+ container, text='[%d]' % (self._mapValue(idx, option)))).grid(
+ row=idx+1, column=0)
(ttk.Checkbutton(
container, text=option.label,
- variable=self.values[idx]
+ variable=self.values[self._mapValue(idx, option)]
)).grid(row=idx+1, column=1, sticky=tk.W)
+ def _mapValue(self, idx, value):
+ return self.options[idx].getMatchID()
+
class BracketMatchSettingsFrame(GuiFrame):
SOURCE_TEAM=0