From b53a4f555f8560de419924692b3c9017f4cc949c Mon Sep 17 00:00:00 2001 From: emkael Date: Sun, 2 Jun 2019 22:22:52 +0200 Subject: Value setter for widget repeater --- jfr_playoff/gui/frames/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'jfr_playoff/gui/frames') diff --git a/jfr_playoff/gui/frames/__init__.py b/jfr_playoff/gui/frames/__init__.py index 82f2966..5de9752 100644 --- a/jfr_playoff/gui/frames/__init__.py +++ b/jfr_playoff/gui/frames/__init__.py @@ -80,6 +80,12 @@ class WidgetRepeater(tk.Frame): return [widget.getValue() for widget in self.widgets if isinstance(widget, self.widgetClass)] + def setValue(self, value): + for i in range(0, len(value)): + if i >= len(self.widgets): + self._addWidget() + self.widgets[i].setValue(value[i]) + class RepeatableFrame(tk.Frame): def __init__(self, *args, **kwargs): tk.Frame.__init__(self, *args, **kwargs) -- cgit v1.2.3