Re: data from tree



>>>>> "J" == Jan Sochman <jena@artax.karlin.mff.cuni.cz> writes:

 J> Does anybody know, how I can get data from selected row in Tree? I
 J> have signal handled but I need to know what I selected.

I did this once.  I'm not sure this is the right way of doing it though.

GtkWidget *
get_selection (GtkTree *tree)
{
  Glist *selection = GTK_TREE_SELECTION (tree);
  return selection ? GTK_WIDGET (selection->data) : NULL;
}

...

selected = main_window_tree_selected(main_window_data);
if (selected) { 
  data = gtk_object_get_user_data(GTK_OBJECT (selected));
}

/mailund



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