Re: Prevent sort of GtkListStore.
On Wed, Jun 12, 2013 at 11:38 PM, dE de.tec...@gmail.com wrote: With gtk_tree_view_column_set_sort_column_id (), it appears that GtkListStore also gets sorted. I don't want that to happen, since the data in it has to be compared. The sorting of GtkTreeView actually sorts the model, it does so using the GtkTreeSortable interface. If you dont want the data model to actually be modified by sorting, then you can use a GtkTreeModelSort, which is an intermediate data model for this particular purpose (just set the GtkTreeModelSort as the model for the GtkTreeView, and set your data model as the child model of the GtkTreeModelSort). Cheers, -Tristan How can I do this? Thanks!! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Prevent sort of GtkListStore.
On 06/13/13 18:49, Tristan Van Berkom wrote: On Wed, Jun 12, 2013 at 11:38 PM, dE de.tec...@gmail.com wrote: With gtk_tree_view_column_set_sort_column_id (), it appears that GtkListStore also gets sorted. I don't want that to happen, since the data in it has to be compared. The sorting of GtkTreeView actually sorts the model, it does so using the GtkTreeSortable interface. If you dont want the data model to actually be modified by sorting, then you can use a GtkTreeModelSort, which is an intermediate data model for this particular purpose (just set the GtkTreeModelSort as the model for the GtkTreeView, and set your data model as the child model of the GtkTreeModelSort). Cheers, -Tristan How can I do this? Thanks!! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list THAT'S IT!!! YES!! THANK YOU!! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Prevent sort of GtkListStore.
With gtk_tree_view_column_set_sort_column_id (), it appears that GtkListStore also gets sorted. I don't want that to happen, since the data in it has to be compared. How can I do this? Thanks!! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Prevent sort of GtkListStore.
I'm not sure what's the GTK equivalent, but in gtkmm (the C++ binding) it's possible to give a TreeView separate sorting which doesn't affect the data, and have multiple Views to sort the same TreeStore using different columns. I assume it's possible for ListStore too. The GTK API ref / tutorial probably mentions that where it explains sorting. I hope that helps, a bit of digging there will probably get you what you're looking for... Anatoly On ד', 2013-06-12 at 20:08 +0530, dE wrote: With gtk_tree_view_column_set_sort_column_id (), it appears that GtkListStore also gets sorted. I don't want that to happen, since the data in it has to be compared. How can I do this? Thanks!! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Prevent sort of GtkListStore.
On 06/12/13 21:24, אנטולי קרסנר wrote: I'm not sure what's the GTK equivalent, but in gtkmm (the C++ binding) it's possible to give a TreeView separate sorting which doesn't affect the data, and have multiple Views to sort the same TreeStore using different columns. I assume it's possible for ListStore too. The GTK API ref / tutorial probably mentions that where it explains sorting. I hope that helps, a bit of digging there will probably get you what you're looking for... Anatoly On ד', 2013-06-12 at 20:08 +0530, dE wrote: With gtk_tree_view_column_set_sort_column_id (), it appears that GtkListStore also gets sorted. I don't want that to happen, since the data in it has to be compared. How can I do this? Thanks!! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list There's some mention of gtk_tree_sortable_set_sort_column ( ) in GtkTreeViewColumn documentation, but there's no mention of it anywhere else. While compiling, this function is not found. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Prevent sort of GtkListStore.
I'll tell you what I do when I encounter this kind of problem. This is a general purpose technique for finding answers for things not well documented. If you made a web-search and there's no helpful tutorial and nothing on the mailing list archives, here's what you can do The gtkmm book provides a short explanation. In most cases it's quite easy to find the GTK functions corresponding to gtkmm ones. Here's the gtkmm book page about TreeView Sorting: https://developer.gnome.org/gtkmm-tutorial/unstable/sec-treeview-sort.html.en If it doesn't help - maybe function name differ from GTK ones - go to the gtkmm source code and find the implementation. But most of gtkmm is auto-generated, so you need to see the source after gmmproc is applied. You can do it manually or simply download the gtkmm source with gmmproc applied, directly from here: http://fossies.org/linux/privat/gtkmm-3.8.1.tar.gz/ Then go to the definition of the gtkmm methods you need, and see which treeview GTK method is used. Then just go to its API documentation. Very often digging like that is the only way. Anatoly On ד', 2013-06-12 at 23:15 +0530, dE wrote: On 06/12/13 21:24, אנטולי קרסנר wrote: I'm not sure what's the GTK equivalent, but in gtkmm (the C++ binding) it's possible to give a TreeView separate sorting which doesn't affect the data, and have multiple Views to sort the same TreeStore using different columns. I assume it's possible for ListStore too. The GTK API ref / tutorial probably mentions that where it explains sorting. I hope that helps, a bit of digging there will probably get you what you're looking for... Anatoly On ד', 2013-06-12 at 20:08 +0530, dE wrote: With gtk_tree_view_column_set_sort_column_id (), it appears that GtkListStore also gets sorted. I don't want that to happen, since the data in it has to be compared. How can I do this? Thanks!! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list There's some mention of gtk_tree_sortable_set_sort_column ( ) in GtkTreeViewColumn documentation, but there's no mention of it anywhere else. While compiling, this function is not found. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list