Re: GtkTreeModelFilter on GtkTreeModelSort



On 27/09/11 17:52, Andrea Zagli wrote:
> can i have a GtkTreeView based on GtkTreeModelFilter based on a
> GtkTreeModelSort?
> 
> i tried but when i click on a column header i get "invalid cast from
> `GtkTreeModelFilter' to `GtkTreeSortable'"
> 
> thanks in advance

If you want the TreeView to be sortable, the GtkTreeView's model must
implement GtkTreeSortable. GtkTreeModelFilter doesn't, GtkTreeModelSort
does - you have to swap the two.

Give the GtkTreeView a GtkTreeModelSort wrapping a GtkTreeModelFilter
(which in turn can wrap your actual data)

Thomas


Attachment: signature.asc
Description: OpenPGP digital signature



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