Richard and Jorge, Many thanks. It works when adding Richard's code snippet to what I already had, i.e. this: void listsetsel ( .... int pos , bool isselect ) { .... GtkTreeView * tv = ... GtkTreeSelection * tsel = gtk_tree_view_get_selection (tv); GtkTreeIter iter ; GtkListStore * store = (GtkListStore *)gtk_tree_view_get_model ( tv ) ; if ( gtk_tree_model_iter_nth_child ( (GtkTreeModel *)store , &iter , NULL , pos ) ) { if ( isselect ) { gtk_tree_selection_select_iter ( tsel , &iter ) ; } else { gtk_tree_selection_unselect_iter ( tsel , &iter ) ; } } char row [20 ] ; sprintf ( row , "%d" , pos ) ; GtkTreePath * path = gtk_tree_path_new_from_string ( row ) ; gtk_tree_view_scroll_to_cell ( GTK_TREE_VIEW (tv), path, NULL, TRUE, 0.0, 0.0 ) ; gtk_tree_view_set_cursor(GTK_TREE_VIEW (tv), path, NULL, FALSE ) ; gtk_tree_path_free ( path ) ; } --- On Thu, 22/7/10, Jorge Kalmbach <kalmbach@xxxxxxxxx> wrote:
|
_______________________________________________ gtk-list mailing list gtk-list@xxxxxxxxx http://mail.gnome.org/mailman/listinfo/gtk-list