Re: Getting data from a Tree View
- From: Harring Figueiredo <harringf yahoo com>
- To: Bijoy Chandrasekharan <bijoy_mc yahoo co in>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Getting data from a Tree View
- Date: Tue, 15 Oct 2002 07:12:54 -0700 (PDT)
void gtk_tree_model_get (GtkTreeModel *tree_model,
GtkTreeIter *iter,
...);
Take a look at the GtkTreeModel docs -- Remember that TreeStore and List store
derive from TreeModel, so you can use all the function from TreeModel on the
Stores.
Harring.
--- Bijoy Chandrasekharan <bijoy_mc yahoo co in> wrote:
hi all,
will anyone give me some hint on how i can access the text from a
GtkTreeView.
I 've created the treeview using a GtkTreeStore by,
/**************************************/
store = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING);
gtk_tree_view_set_model(GTK_TREE_VIEW(widget), GTK_TREE_MODEL
(store) ) ;
select = gtk_tree_view_get_selection (GTK_TREE_VIEW(widget));
gtk_tree_selection_set_mode (select, GTK_SELECTION_MULTIPLE);
text_renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new();
gtk_tree_view_column_pack_end(column, text_renderer, TRUE);
gtk_tree_view_column_add_attribute (column, text_renderer, "text",
TITLE_COL);
gtk_tree_view_append_column (GTK_TREE_VIEW (widget), column);
gtk_tree_store_append (store, &iter, NULL);
gtk_tree_store_set (store, &iter, TITLE_COL, "ROOT", -1);
gtk_tree_store_append (store, &iter2, &iter);
gtk_tree_store_set (store, &iter2, TITLE_COL, sub_tree_name, -1);
attach_group_to_tree_store(store, &iter2, tree, column,
sub_tree_name ) ;
..........
/*****************************************************************/
where " attach_group_to_tree_store(...)" will recursively attach the
groups to the tree in a
DEPTH FIRST model.
After this how can i get the TEXT i attached to the tree when each row
is selected.
thanks for any help,
regds ,
bijoy.
________________________________________________________________________
Missed your favourite TV serial last night? Try the new, Yahoo! TV.
visit http://in.tv.yahoo.com
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]