Re: How to use GtkTreeSortable



On Wed, 2002-02-06 at 06:53, Oleg N. Mayboroda wrote:
Hello all,
I have got a question about the use of GtkTreeSortable,
GtkTreeModelSort. Can somebody give an example of these interfaces
using? What is GtkTreeIterCompareFunc (what should it return )? These
items are undocumented (in testtreesort.c from CVS this question is not
clarified too).

GtkTreeIterCompareFunc is (slghtly) documented here:
http://developer.gnome.org/doc/API/2.0/gtk/gtk-gtktreesortable.html#GTKTREEITERCOMPAREFUNC

gint (*GtkTreeIterCompareFunc)       (GtkTreeModel *model,
                                             GtkTreeIter *a,
                                             GtkTreeIter *b,
                                             gpointer user_data);

The return value isn't specified, but I presume that, like other sorting
functions I have seen, return -1 if a < b, 0 if a == b, and 1 if a > b. 
Logically, you return a - b.

-jwb




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