Re: TreeFilterModel and sorting



I've just run into this problem (using pygtk).

I'd like to have a liststore that is both sortable and filterable.  

In fact, I had such a beast, but I was using my own nasty hacks to implement the filtering.  I've had on my to-do list to switch to the TreeModelFilter + I've just tried that -- unfortunately it seems I can either have filtering or sorting, but not both.

Am I missing some trick?

John

bernd wrote:
TreeFilterModel and sorting

Hi,
we use GtkTreeModelFilter to filter a modell to diff. views. Ok it
works. But we can't sorting the view because the model in dthe view is
not a SORTABLE.
In function:
gboolean
gtk_tree_sortable_get_sort_column_id (GtkTreeSortable  *sortable,
                                      gint             *sort_column_id,
                                      GtkSortType      *order)
{
  GtkTreeSortableIface *iface;

  g_return_val_if_fail (GTK_IS_TREE_SORTABLE (sortable), FALSE);

from gtk_tree_column_sort:

  has_sort_column =
    gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE
(GTK_TREE_VIEW (tree_column->tree_view)->priv->model),
                                          &sort_column_id,
                                          &order);

we get the error message:
Gtk-CRITICAL **: file gtktreesortable.c: line 108
(gtk_tree_sortable_get_sort_column_id): assertion `GTK_IS_TREE_SORTABLE
(sortable)' failed

Is it not possible to sort a view with FilterModel?
Or have me make a failure in bilding the view?

MfG Bernd

_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list



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