Re: [gtkmm] TreeView assertion "has_next" failed



On Sat, 2004-04-17 at 20:28, Sverre Sundsdal wrote:
> Hello.
> I have a custom ListViewModel where elements are inserted dynamically. 
> First I add the element to the STL vector, then I use the following code 
> to update the treeview.
>  
>    Gtk::TreeNodeChildren allNodes = mListModel->children();
>     Gtk::TreeNodeChildren::size_type numNodes = allNodes.size();
>     Gtk::TreeModel::Path path;
>     path.push_back(numNodes);
>     Gtk::TreeModel::iterator iter = mListModel->get_iter(path);

It would be good to check that the  iter is valid here, with an
if(iter)
{
}

>     mListModel->row_inserted(path, iter);

Why are you calling this method? I don't know when anybody would need to
call it.

> The program seems to be working fine, but when viewing the treeview I 
> get the following error repeatedly in the console:
> <snip>
> Gtk-CRITICAL **: file gtktreeview.c: line 3353 
> (gtk_tree_view_bin_expose): 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.
> </snip>
> The following error i get for each row inserted.
> Gtk-CRITICAL **: file gtktreeview.c: line 4177 (validate_visible_area): 
> assertion `has_next' failed.
> 
> Does anyone have an idea what this might be?
> thanks in advance
> sverre sundsdal
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
-- 
Murray Cumming
www.murrayc.com
murrayc murrayc com




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