code: def do_search(self, arg=None):
          
          new_cats = []
          for cat in self.cats:
              new_cat = cat.search(self.inputs.text,
                                   depth=self.inputs.depth)
              if len(list(new_cat)) > 0:
                  new_cats.append(new_cat)
          if len(new_cats) > 0:
              self.done_callback(new_cats)
              self.visible = False
docs: Do search and close panel