1

I've been attempting to modify the contents of a custom tree view that inherits from TreeModel and TreeSortable. However, the virtual function set_value_impl contains only an assert. When I tried to look for example implementations, they all quote the GTKMM website which says "You can probably just implement this by calling set_value_vfunc()".

I have not found such function to exist anywhere in GTKMM.

Has anyone here run afoul of the GTKMM TreeModel when trying to modify the contents of a tree view?

gpoo
  • 8,408
  • 3
  • 38
  • 53
  • Can you link to the GTKMM documentation you quote? – ptomato Oct 05 '11 at 10:57
  • *Edit: I think I found it: http://developer.gnome.org/gtkmm/stable/classGtk_1_1TreeModel.html#a26cf070eadb8e242bcf2b57f7e6d7d9e Is there a reason you don't want to use ListStore or TreeStore? – Christian Smith Oct 05 '11 at 14:55
  • The contents of the TreeView are the product of a SQLQuery, and for some reason we are relying on the TreeSort widget to do the sorting for us. I begin to suspect that it is our implementation that is to fault, and not necessarily gtkmm. I realize that this is quite the edge-case. I just wanted to know if anyone has had success with the set_value_vfunc function. – River-Claire Williamson Oct 05 '11 at 20:16
  • I'll be frank, but I can't find it. I even downloaded the gtkmm sources (3.0) and looked to see if Liststore or something was using it, and not a single one is. I can't find any reference to it, except on the net for this question and the docs (it seems to be used in a gtk library (libgda-uimm, but it is virtual). I think you might be right about your case being an edge one. Maybe look over the built-in models' source code to see how the gtkmm devs used the inherited classes. – Christian Smith Oct 05 '11 at 20:32
  • That's what I suspected. Could you submit your comment as an answer? – River-Claire Williamson Oct 06 '11 at 14:50

1 Answers1

0

As covered in the comments above, the set_value_vfunc() function simply does not exist.

gpoo
  • 8,408
  • 3
  • 38
  • 53
  • I have corrected the documentation by removing that mention: http://git.gnome.org/browse/gtkmm/commit/?id=e8229e67cb152ea2264bb60c5bd633243c3aef30 – murrayc Jan 31 '13 at 08:58
  • Here is how I implement that function in my database-backed TreeModel. It's not meant to be example code but it seems to work: http://git.gnome.org/browse/glom/tree/glom/mode_data/datawidget/treemodel_db.cc#n767 – murrayc Jan 31 '13 at 08:59