Re: [gtk-list] Re: data from tree



>  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;
> }

But selection->data doesn't contain any string which I want. There are
only random characters.

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

I don't understand. Is it part of main program? What has it to do? I have
no function named main_window_tree_selected... 
I tried *_get_user_data in callback function but it also doesn't work :-(.
Do you have any idea what to do?

					Jen~a



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