Re: TreeView update



I'd say the model you use doesn't emit the row-changed, row-inserted or row-deleted signals; the fact that it updates on full redraw is clear then since only then TreeView itself would query the model for data, otherwise when single rows get deleted, it would listen to the signal(s).
What TreeModel do you use? Normal gtkmm ListStore?

2008/6/5 Dinh Khac Thanh <thanhdk gmail com>:
Hi all,

I created a TreeView and a ListStore TreeModel in a Maemo application. The model is updated dynamically with data from an input file.

Gtk::TreeView m_TreeView;
Glib::RefPtr<Gtk::ListStore> m_refTreeModel;
To add row:
Gtk::TreeModel::Row row = *(m_refTreeModel->append());

To delete row:
typedef Gtk::TreeModel::Children type_children;
type_children children = m_refTreeModel->children();
type_children::iterator iter = children.begin();
and
iter=m_refTreeModel->erase(iter); //in a while loop

It works fine if I either keep click on the TreeView window or generate an expose event on TreeView (switch to another window and switch back). But if I don't give it focus TreeView does not change. After a while I got this and a seg fault:

 GLIB CRITICAL ** Gtk - file gtktreeview.c: line 5232 (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.

Is there anyway to make TreeView automatically update ?

Regards
--
Dinh Khac Thanh
You can do anything, but not everything
You miss 100 percent of the shots you never take

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list




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