Re: [gtk-list] Tree widget



Kevin N Shallow wrote:
> 
> Hello,
> 
> I having a little trouble deciphering how to handle traversing a tree
> widget's hierarchy. I know that I can find out which GtkTree a
> GtkTreeItem was selected from, but then what?  The GtkTreeItem structure
> provides no way to tell what the parent tree is, or at least that's my
> perception. Is there a way to traverse a GtkTreeItem selection back to
> the original tree?

I'm not sure exactly with a GtkTree, but the following works for a
GtkCTree. I would have thought similar is possible. If not, just use a
CTree with one column and no titles...

      GtkCTreeNode *a_node; 

      while (GTK_CTREE_ROW (a_node)->parent != NULL) {
	 /* Do anything you want to the parent node */
         parent = GTK_CTREE_ROW(a_node)->parent;
      }

This will stop when it finds a node with no parent (ie. at the root of
the tree).

Regards,

--
Lee.
http://atlas.cs.york.ac.uk/~lrpm100/

"I may be dead, but I'm still pretty."




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