Re: [gtkmm] Updating a custom TreeModel



Christer Palm wrote:
Tor Arvid Lund wrote:

The TreeView associated with the Custom TreeModel will always show the first row in the vector, so my question is: How do I tell the TreeModel that new data is available in the vector?


Your custom TreeModel needs to use the following methods to announce changes to the model:

  TreeModel::row_changed()
  TreeModel::row_inserted()
  TreeModel::row_has_child_toggled()
  TreeModel::row_deleted()
  TreeModel::rows_reordered()

Thanks for replying. This makes sense. Sorry if it is just me who is being stupid here, but: If I'm going to call row_inserted for instance, I need a Gtk::TreeModel::Path and a Gtk::TreeModel::iterator object to pass to it. These - it seems - needs to be generated from the new element in my vector.

It looks like the path can be created from the iterator, but I cannot see how I should generate the iterator. Could anyone give me an example or perhaps point me to one?

Thanks in advance,
Tor Arvid Lund

Attachment: signature.asc
Description: OpenPGP digital signature



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