Re: GtkTreeSelection error msgs.



On Tue, 2002-11-26 at 16:41, Harring Figueiredo wrote:

 Folks,

 Is there a function I can call to notify the View of changes on the Model so
that I can get rid of these messages ?

" (table_example:16493): Gtk-CRITICAL **: file gtktreeselection.c: line 491
(gtk_tree_selection_selected_foreach): assertion `has_next' failed.
There is a disparity between the internal view of the GtkTreeView,
and the GtkTreeModel.  This generally means that the model has changed
without letting the view know.  Any display from now on is likely to
be incorrect. "


 What I am doing is deleting rows on the GtkTreeList inside the call to the
foreachFunc on   gtk_tree_selection_selected_foreach.

Which is absolutely *not* allowed. GTK+ >= 2.0.9 and GTK+ > 2.1.2 have
protection built-in to avoid this kind of things.


  -- Note: I coudl get way with:
   1) Iterate through all nodes (rows)
   2) if selected -- remove node --

What you have to do is:
 1) build a list of nodes you want to remove
 2) remove the nodes

That's the safest approach. This is a bit annoying to write in GTK+ 2.0,
but it will be better in 2.1 (because you can use the new
gtk_tree_selection_get_selected_rows function).



regards,


        Kris



 But I think that this is very impractical and slow -- 


Thanks in advance.
      


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
_______________________________________________
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]