Re: GtkTreeModelFilter and GtkTreeSortable



On Fri, 2007-09-28 at 23:49 -0300, MatÃÂas Alejandro Torres wrote:
Hi,

I'm building an application in which there's a tree view that used to 
display a sortable tree model. Yesterday I started using a 
GtkTreeModelFilter for searching patterns in this sortable model.

My problem is that GtkTreeModelFilter does not implements the 
GtkTreeSortable interface and I lost the sorting capabilities that I 
used to have.

use a filter on the sort model:

  GtkTreeModel implementation (list store, tree store, etc.)
  +---- GtkTreeModelSort
        +---- GtkTreeModelFilter

you just need to remember to convert the iterators given to you by the
GtkTreeView widget *twice*: one from the filter to the sort model, and
one from the sort model to the real model.

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net




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