GtkListBox with a model and a filter func

I’ve added a search filter to a simple app I’m working on; I’m using a GtkSearchEntry, and its current state is used to filter a GtkListBox using a filter function on the list box. Note: my list box is populated by a GtkListStore model.

It’s working great; I can filter my list box quite nicely and all seems well, except, on the console I see this error:

Gtk-WARNING **: 14:20:39.390: GtkListBox with a model will ignore sort and filter functions

Should I NOT use a filter func when my list box is populated by a model? And if so, what’s the best way to filter a model? Do I need to recreate the model doing my own filtering?

Interestingly, according to the documentation, the filter function wasn’t even supposed to work when the Gtk.ListBox is populated by a Gtk.ListStore.

Anyway, the recommended way to filter a Gtk.ListStore is using a Gtk.FilterListModel.

FilterListModel - fantastic, thanks for the pointer!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.