Re: Problem with GtkTreeSelection



Hi, 

On Tue, 21 Dec 2004 10:03:23 -0600, Bob Caryl <bob fis-cal com> wrote:
> pressing):  I cannot programmatically select a row in a GtkTreeView (a simple
> list box analogy w/o children) using the gtk_tree_selection_select_path
> function. 

I do this with:

  path = gtk_tree_model_get_path( GTK_TREE_MODEL( store ), &iter );
  gtk_tree_view_expand_to_path( GTK_TREE_VIEW( tree ), path );
  gtk_tree_view_set_cursor( GTK_TREE_VIEW( tree ), path, NULL, FALSE );
  gtk_tree_path_free( path );

Given an iter, this opens that part of the tree and selects the row. 

One thing that bit me: if you have callbacks which spot select
actions, they will be triggered by this. You may need to block those
signals before calling these functions.

John



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]