After debugging the translated c sources i found the bug.
vala
translates
public void render_value (Gtk.TreeViewColumn column,
Gtk.CellRendererText cell,
Gtk.TreeModel model,
Gtk.TreeIter iter)
from your code to the following c equivalent
void application_render_value (Application* self,
GtkTreeViewColumn* column,
GtkCellRendererText* cell,
GtkTreeModel* model,
GtkTreeIter* iter)
I compared this with the reference docs.
There the signature of the data function is defined as follows
void (*GtkCellLayoutDataFunc) (GtkCellLayout *cell_layout,
GtkCellRenderer *cell,
GtkTreeModel *tree_model,
GtkTreeIter *iter,
gpointer data);
With regard to the method you have implemented that means that the arguments are shifted by one to the right. So the following applies to your data func/method
column
is in fact the cell renderercell
is the tree modelmodel
is the iterator anditer
is the data that is passed to the function/method
If you change the declaration of your data func/method to
public void render_value (Gtk.CellRendererText cell,
Gtk.TreeModel model, Gtk.TreeIter iter, Object data)
everything should work fine.
Maybe the reason of this is that CellLayoutDataFunc
is defined as public delegate void
. But since i don't know anything about vala
it's just a guess. If it's not the case you may post this on a related vala
mailing list.