From 69c0e0733b6c254e798bfd75569d80d220eb4a15 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 27 Jun 2019 20:44:23 +0200 Subject: SelectionButton/Frame with custom value mappings --- jfr_playoff/gui/frames/team.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'jfr_playoff/gui/frames/team.py') diff --git a/jfr_playoff/gui/frames/team.py b/jfr_playoff/gui/frames/team.py index 8d789b9..a304040 100644 --- a/jfr_playoff/gui/frames/team.py +++ b/jfr_playoff/gui/frames/team.py @@ -58,11 +58,12 @@ class TeamManualSettingsFrame(GuiFrame): class TeamSelectionFrame(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[0], - variable=self.values[idx] + variable=self.values[self._mapValue(idx, option)] )).grid(row=idx+1, column=1, sticky=tk.W) class TeamSelectionButton(SelectionButton): -- cgit v1.2.3