[gtkada] Sorting list/tree model

Rob Groen robgr at xs4all.nl
Fri Sep 10 11:17:48 CEST 2004


>
> Use Gtk.Tree_View_Column.Set_Sort_Column_Id. Then you can click
> on the column header to sort it by that column.
>
> Manuel
>
>
Thanks, that works. However, I can't find a way to set the compare function
used for sorting. It is unclear what the sorting criteria are (apart from
ascending and descending). Resetting to default (whatever that is) can be
done with Gtk.Tree_Model_Sort.Reset_Default_Sort_Func. Gtk.Tree_Model_Sort
seems incomplete to me since there is no way the create a
Gtk_Tree_Model_Sort object.

Furthermore, I need to sort from the code, without having to rebuild the
complete tree after sorting the data. I can use the Clicked procedure in
Gtr.Tree_View_Column to simulate the user clicking the column header, but
that also triggers the callbacks defined for the column headers, which is
not what I want.


Rob




More information about the gtkada mailing list