Where is the iter?



Hi,

My app stores 4 "gtk_list_store" in a array-pointers for "instance" of:

struct _elem
{
	GtkWidget *view;
	GtkListStore *table;
	GtkTreeIter iter;
};

When app runs, random lines are added in a random *table above.
Example:
a row added in first table
a row added in third table
a row added in second table
a row added in second table
and so on

With a dialog, app permits to select a row (example: 2nd table 5th row) by:

gtk_tree_model_iter_nth_child (GTK_TREE_MODEL(elem->table), &elem->iter, NULL, row);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(elem->view));
gtk_tree_selection_select_iter (selection, &elem->iter);

However it doesn't work.
I got runtime errors like "assertion `path != NULL' failed"

In a Tim-Philipp Müller tutorial, I can read:
"Tree iters are often only valid for a short time, and might become invalid if the store changes with some models.
It is therefore usually a bad idea to store tree iters, unless you really know what you are doing."

Ok, I don't know what I'm doing:) My _elem structure stores "iter"...

How can I retrieve right "iter" to select a row?

Thank you very much
Giulio


 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f

 Sponsor:
 Bisogno di liquidità? Non devi spiegare per cosa. Fino a 4.000 ? a casa tua
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid"91&d-1



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