I have an underlying model for a TreeView in my application that I am filtering based on certain user selections. I maintain a global reference to the "base" TreeModel (which is sometimes attached to the TreeView used to display the information.) The mechanism I am using goes something like this:
1. User selects a new filter criteria 2. (Depending on the selection) Either a) gtk_tree_model_filter_new to create a new filter based on the user's criteria from the global "base" model or b) use the base model. 3. gtk_tree_view_set_model( [selected model]) I was thinking this is probably leaving a bunch of filtered tree models around that aren't doing anything but taking up space...do I need to be g_object_unref'ing the old filter models? I attempted a "replace" function that looks something like: void replaceTreeModel(GtkTreeModel *model) { GtkTreeView *treeview = [get the widget]; GtkTreeModel *currentModel = gtk_tree_view_get_model(treeview); gtk_tree_view_set_model( treeview, model ); // The following makes the application unstable and crash in the filter function so I've commented it out for now //if (GTK_IS_TREE_MODEL_FILTER( currentModel)) //{ // g_object_unref( G_OBJECT(currentModel)); //} } What is the best/proven way of doing something like this? Thanks, Matt _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list