After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 145579 - Difficulty setting the initial selection in GtkTreeView
Difficulty setting the initial selection in GtkTreeView
Status: RESOLVED DUPLICATE of bug 143270
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
2.4.x
Other Linux
: Normal normal
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2004-07-07 18:08 UTC by George Williams
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description George Williams 2004-07-07 18:08:50 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);
    }
Comment 1 Matthias Clasen 2004-07-08 02:43:54 UTC

*** This bug has been marked as a duplicate of 143270 ***