Re: Re: Q: How to get selected tree iter's index?



thx, I have understood indices. It is a serial of index no for each level.
Fortunately, I need just only ONE level, so I use simply

//...
idx=*indices;

you want the path indices, or, more precisely, something like this:
gint depth, *indices, idx;
depth = gtk_tree_path_get_depth(path);
indices = gtk_tree_path_get_indices(path);
g_assert(depth > 0); /* depth 0 = invisible root of the tree view */
idx = indices[depth-1];
That gives you the 'n' as in 'the n-th child of the parent node' that this
row
is (if that's what you wanted).
Cheers
-Tim



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