code: def get_window(self): 
          
          x = self
          while not x._parent == None and \
                not isinstance(x._parent, Window): 
                    x = x._parent
          return x._parent
docs: Returns the object's parent window. Returns None if no window found.