Fwd: GtkTreeView, GtkListStore and more...



Thanks,
I'll take it into account, but it doesn't fix the problem. The iter is not
incremented... I don't know why. The compilation shows no errors as the
debug terminal does not.

Can you point me to an example on how to traverse a GtkListStore?

Thanks

---------- Forwarded message ----------
From: Iago Rubio <iago iagorubio com>
Date: Aug 17, 2006 6:14 PM
Subject: Re: GtkTreeView, GtkListStore and more...
To: gtk-app-devel-list gnome org

On Thu, 2006-08-17 at 17:43 +0200, Fernando Apesteguía wrote:

for(....){
   ...
   if(should_be_deleted)
        gtk_list_store_remove(model,&iter);
....
gtk_tree_model_iter_next(GTK_TREE_MODEL(model),&iter);
}

Try:

  if(should_be_deleted)
       gtk_list_store_remove(model, &iter);
  else
       gtk_tree_model_iter_next(GTK_TREE_MODEL(model),&iter);

gtk_list_store_remove() updates the iter to point to the next element,
so you should call gtk_tree_model_iter_next if the list item have not
been deleted. Otherwise you're moving the iter twice - one on remove,
second on  gtk_tree_model_iter_next.

Cheers.
--
Iago Rubio

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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