You can use Gtk.Treeview.set_search_equal_func()
for this:
def __init__(self):
...
treeview.set_search_equal_func(self.search_function)
self.treeview = treeview
def search_function(self, model, column, key, rowiter):
row = model[rowiter]
if key.lower() in list(row)[column-1].lower():
return False # Search matches
# Search in child rows. If one of the rows matches, expand the row so that it will be open in later checks.
for inner in row.iterchildren():
if key.lower() in list(inner)[column-1].lower():
self.treeview.expand_to_path(row.path)
break
else:
self.treeview.collapse_row(row.path)
return True # Search does not match
I would recommend gnome.org for documentation on Gtk. It doesn't have all of the latest updates, but it has easy-to-read and easy-to-find documentation on many of the Gtk classes and functions.