From da515b8bbbd8b2d840920a6296f5d09f6c32414d Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 27 Dec 2019 21:28:37 +0100 Subject: Fetching GUI parent frame of specific type --- jfr_playoff/gui/frames/__init__.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/jfr_playoff/gui/frames/__init__.py b/jfr_playoff/gui/frames/__init__.py index cca19a5..97f55bf 100644 --- a/jfr_playoff/gui/frames/__init__.py +++ b/jfr_playoff/gui/frames/__init__.py @@ -153,14 +153,16 @@ class GuiFrame(tk.Frame): def renderContent(self): pass -class RepeatableFrame(tk.Frame): - def __init__(self, *args, **kwargs): - tk.Frame.__init__(self, *args, **kwargs) - self.renderContent() + def getSpecificParent(self, parentType): + obj = self + while not isinstance(obj, parentType): + obj = obj.master + if obj is None: + break + return obj - def renderContent(self): - pass +class RepeatableFrame(GuiFrame): def configureContent(self, **kwargs): pass -- cgit v1.2.3