Compare function on CTree



HEllo.

I have a CTree widget (depth = 2).
Toplevel nodes (nodes without parent, depth = 1) have a data field with type
data1_t*
Nodes within the tree (nodes with parent, depth = 2) have a data field with
type data2_t*

I worte a compare function upon the CTree widget:

gtk_clist_set_compare_func(GTK_CLIST(ctree), ctree_compare);

gint ctree_compare (GtkCList      *clist,
                    gconstpointer  ptr1,
                    gconstpointer  ptr2);

ptr1 and ptr2 are of type GtkCListRow*, right?

Now i'd like to compare the two rows, i want to do it using the data fields (i
dont like to parse the text in the CTree itself). 
ALso i dont want to do a gtk_ctree_search or something like that.

Is there a way to convert ptr1 and ptr2 to type GtkCTreeNode* ? If not
how do i detect the depth of ptr1 and ptr2, or how do i detect the type 
of the data field?




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