Getting the "path" in a gtk tree



Hello,

I'v built a whole tree with items and subtrees using 
gtk_tree_new, gtk_tree_append, gtk_tree_item_set_subtree.

Now, I want to get the full path of an selected item  (the names of all the tree names from the 
root).

I've looked in gtk+-1.2.2/examples/tree: 

I use gtk_signal_connect (GTK_OBJECT(subtree), "select_child",                     
GTK_SIGNAL_FUNC(cb_select_child), subtree);
                     
I can get the selection list with GTK_TREE_SELECTION(tree),

But I cannot figure how to get the root item of a subtree.

I don't see where it is stored in _GtkTree (root_tree ? tree_owner ?), and what
macros to use to get the data. (I've done many tries, which all failed)
 
struct _GtkTree
{
  GtkContainer container;

  GList *children;

  GtkTree*  /* owner of selection list */ 
  GtkWidget* 
  GList *selection;
  guint level;
  guint indent_value;
  guint current_indent;
  guint selection_mode : 2;
  guint view_mode : 1;
  guint view_line : 1;
};

Thanks for your help.



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