GtkTreeView children missing when filterable and sortable
[email protected] (Jake Cobb)
| Newsgroups | php.gtk.general |
|---|---|
| Message-ID | <[email protected]> |
Hello, I have a GtkTreeView where I wanted both custom filtering and the ability to sort by column. Originally my model was a GtkListStore, but to include filtering I wrapped it in a GtkTreeModelFilter. However, since GtkTreeModelFilter does not implement the GtkTreeSortable interface this made the columns unsortable by hiding the GtkListStore which does implement GtkTreeSortable. So, to restore sortablity I further wrapped the GtkTreeModelFilter in a GtkTreeModelSort. This worked correctly and I was able to make the GtkTreeView sortable and filterable at the same time. The new problem I'm having results from changing to a GtkTreeStore as the base model. Now I need parent-child relationships, but with this configuration (GtkTreeStore/GtkTreeModelFilter/GtkTreeModelSort) no child nodes ever appear and no expanders are shown for root nodes that have children. This seems like a bug. All of the following configurations (several of which serve no practical purpose other than to illustrate they don't cause the problem) show the child nodes as expected: GtkTreeStore GtkTreeStore/GtkTreeModelFilter GtkTreeStore/GtkTreeModelSort GtkTreeStore/GtkTreeModelSort/GtkTreeModelFilter Is there an expected (non-bug) reason this happens? Is there a workaround? -Jake Cobb P.S. I've posted before about my attempt to combine the filtering and sorting into a single class from within PHP, but its been some time since that post so I'll repeat it here. I implemented a custom class in PHP that extends GtkTreeModelFilter and implements GtkTreeSortable. For each of the GtkTreeSortable methods, my class called the method of the underlying model. This does not work because Gtk+, on the C side of things, will not recognize that you've implemented the sorting methods and complains with the following: (php.exe:304): Gtk-CRITICAL **: gtk_tree_sortable_get_sort_column_id: assertion `GTK_IS_TREE_SORTABLE (sortable)' failed