GNOME Bugzilla – Bug 145579
Difficulty setting the initial selection in GtkTreeView
Last modified: 2004-12-22 21:47:04 UTC
I am trying to implement a simple list with a single item selected initially. I use the following code to set the initial selection, but it does not work. The first item in the list is always selected. gtk_tree_selection_set_mode( select, GTK_SELECTION_SINGLE); if ( def>=0 ) { GtkTreePath *path = gtk_tree_path_new_from_indices(def,-1); gtk_tree_selection_select_path(select,path); gtk_tree_path_free(path); }
*** This bug has been marked as a duplicate of 143270 ***