Wednesday 15 August 2012

gtk - How to select a GtkTreeview row by id in C -


I want to select a GTQ Reviewview line by specifying ID with the GTK + version.

I found this function:

  gtk_tree_selection_select_iter (GtkTreeSelection * selection, GtkTreeIter * iter);   

Unfortunately, I do not know how to get GtkTreeSelection and GtkTreeIter items from a specific ID. GtkTreeIter, which needs a GtkTreePath and a GtkTreePath to gtk_tree_path_new_from_string () to use

Can be created by calling or gtk_tree_path_new_from_indices () . Alternatively, if you already have a GtkTreePath, but want to move to the next / previous iterator, you can call gtk_tree_path_next () or gtk_tree_path_prev () You can.

> I have written a demo app for you to select the tree when you press the spin button. Full code can be found

Below is a screenshot:

screenshot

No comments:

Post a Comment