Re: GtkTreeModelFilter and GtkTreeSortable



On Fri, 2007-09-28 at 23:49 -0300, Matí­as Alejandro Torres wrote: 
My problem is that GtkTreeModelFilter does not implements the 
GtkTreeSortable interface and I lost the sorting capabilities that I 
used to have.

It's been a while since I worked on the code in question, but I had a
GtkTreeView that had both GtkTreeModelSort and GtkTreeModelFilter going
on at the same time. You nest them. Something like:

listStore = gtk_list_store_new(...);
filteredStore = gtk_tree_model_filter_new(listStore, NULL);
sortedStore = gtk_tree_model_sort_new_with_model(filteredStore);

view = gtk_tree_view_new_with_model(sortedStore);


(You need to keep references to each one around so you can call the
different methods that only appear on each one. That's probably what you
were stuck on)

No one ever told me that this was "ok" or "correct", but it seemed to
work. I'm sure there's a more appropriate way to do it.

AfC
Sydney

-- 
Andrew Frederick Cowie

We are an operations engineering consultancy focusing on strategy,
organizational architecture, systems review, and change management
procedures: enabling successful use of open source in mission
critical enterprises, worldwide.

http://www.operationaldynamics.com/

Sydney   New York   Toronto   London


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]