TreeView update



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

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