GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Sep 02, 2014 2:01 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: How I can have selected the first row in a GtkTreeView, when
PostPosted: Sun Oct 23, 2011 4:36 pm 
Offline
Familiar Face

Joined: Fri Jul 15, 2011 11:41 am
Posts: 12
I have a gtktreeview with two cellrenderers (pixbuf and text) and I want it is always selected the first row of th gtktreeview when it appears. How I can do this?

I have tried this, but does not work.

path = gtk_tree_path_new_first;
gtk_tree_view_set_cursor( GTK_TREE_VIEW (treeview), path, NULL, FALSE );
gtk_tree_path_free( path );


Top
 Profile  
 
 Post subject: Re: How I can have selected the first row in a GtkTreeView,
PostPosted: Tue Oct 25, 2011 4:37 am 
Offline
Familiar Face

Joined: Mon Jul 11, 2011 10:24 am
Posts: 15
GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
GtkTreeIter iter;

gtk_tree_model_get_iter_first (model, &iter);
gtk_tree_selection_select_iter (selection, &iter);


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group