Re: a TreeModel that's sortable and filterable?
- From: Murray Cumming <murrayc murrayc com>
- To: Jamf <jamf gm gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: a TreeModel that's sortable and filterable?
- Date: Sun, 15 Jun 2008 12:17:19 +0200
On Sun, 2008-06-15 at 11:33 +0200, Jamf wrote:
> Armin Burgmeier escribió:
> > TreeModelFilter and TreeModelSort have child models. So, if you have
> > some TreeModel A, and you want it sorted, then create a TreeModelSort
> > with A as child. If you want it both sorted and filtered, then create a
> > TreeModelFilter with a TreeModelSort as child (or vice versa).
> >
> > Note that Gtk::ListStore and Gtk::TreeStore already support sorting
> > (since they implement Gtk::TreeSortable), so you don't even need
> > Gtk::TreeModelSort for them (unless you want to do things like showing a
> > sorted and an unsorted model in different views).
> >
> I have similar situation in my project.
> If I put ListStore as the model in the treeview, then the sorting
> properties work correctly, but when a TreeModelFilter (with the
> liststore as child) is used as the model in the treeview, the
> ListStore's sorting properties don't work
Can't you put the TreeModelFilter in a TreeModelSort?
> and I get:
> "Gtk-CRITICAL **: gtk_tree_sortable_get_sort_column_id: assertion
> `GTK_IS_TREE_SORTABLE (sortable)' failed
> Gtk-CRITICAL **: gtk_tree_sortable_has_default_sort_func: assertion
> `GTK_IS_TREE_SORTABLE (sortable)' failed"
> Then the only way to get sorting properties is creating a new
> TreeModelSort with the TreeModelFilter as child.
>
> Regards:
> Juan Ángel Moreno Fernández
--
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]