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.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/jfr_playoff/gui/frames/visual.py b/jfr_playoff/gui/frames/visual.py
index b36a5ec..372f02f 100644
--- a/jfr_playoff/gui/frames/visual.py
+++ b/jfr_playoff/gui/frames/visual.py
@@ -6,7 +6,7 @@ import tkColorChooser as tkcc
from ..frames import GuiFrame, RepeatableFrame, ScrollableFrame
from ..frames import WidgetRepeater
-from ..frames import SelectionFrame
+from ..frames import SelectionFrame, RefreshableOptionMenu
from ..frames.team import TeamSelectionButton
class VisualSettingsFrame(GuiFrame):
@@ -141,13 +141,25 @@ class VisualSettingsFrame(GuiFrame):
field.configure(state=tk.NORMAL if var.get() else tk.DISABLED)
+class MatchList(RefreshableOptionMenu):
+ def __init__(self, *args, **kwargs):
+ RefreshableOptionMenu.__init__(self, *args, **kwargs)
+ self.winfo_toplevel().bind(
+ '<<MatchListChanged>>', self.refreshOptions, add='+')
+ self.configure(width=10)
+
+ def getOptions(self):
+ return [match.label for match in self.winfo_toplevel().getMatches()]
+
+
class BoxPositionFrame(RepeatableFrame):
def renderContent(self):
self.match = tk.StringVar()
self.vertical = tk.IntVar()
self.horizontal = tk.IntVar()
self.horizontal.set(-1)
- (ttk.OptionMenu(self, self.match)).grid(row=0, column=0)
+ self.matchBox = MatchList(self, self.match)
+ self.matchBox.grid(row=0, column=0)
(ttk.Label(self, text=' w pionie:')).grid(row=0, column=1)
(tk.Spinbox(
self, textvariable=self.vertical, from_=0, to=9999,