Here is a test program that works, you can try it out:
#!/usr/bin/env pike
void fixed_toggled(object w, array data, object ts) {
GTK2.TreePath path=GTK2.TreePath(data[0]);
// write("path==%O\n",path);
GTK2.TreeIter iter=ts->get_iter(path);
int val=ts->get_value(iter,3);
// write("val==%d\n",val);
val=!val;
ts->set_value(iter,3,val);
}
int main(int argc, array argv) {
GTK2.setup_gtk();
object w=GTK2.Window(GTK2.WINDOW_TOPLEVEL);
object vb=GTK2.Vbox(0,8)->set_border_width(8);
w->add(vb);
vb->pack_start(GTK2.Label("Jonathan's Holiday Card Planning Sheet"),0,0,0);
object sw=GTK2.ScrolledWindow();
sw->set_shadow_type(GTK2.SHADOW_ETCHED_IN)
->set_policy(GTK2.POLICY_AUTOMATIC,GTK2.POLICY_AUTOMATIC);
vb->pack_start(sw,1,1,0);
GTK2.TreeStore ts=GTK2.TreeStore(({ "string","int","int","boolean","string" }) );
object iter=ts->append();
ts->set_row(iter,({ "foo",1,2,0,GTK2.STOCK_OPEN }) );
iter=ts->append();
ts->set_row(iter,({ "bar",3,47,1,GTK2.STOCK_CLOSE }) );
iter=ts->append();
ts->set_row(iter,({ "baz",124,97,0,GTK2.STOCK_DELETE }) );
GTK2.TreeView tree=GTK2.TreeView(ts);
GTK2.CellRenderer gcr=GTK2.CellRendererText();
array(GTK2.TreeViewColumn) cols;
cols=allocate(5);
// write("gcr==%O\n",gcr);
//
write("family==%s\n",gcr->get_property("family"));
/*
cols[0]=GTK2.TreeViewColumn()->set_title("Name")
->pack_start(gcr,1)
->add_attribute(gcr,"text",0);
*/
cols[0]=GTK2.TreeViewColumn("Name",gcr,"text",0);
gcr=GTK2.CellRendererText();
cols[1]=GTK2.TreeViewColumn("Val 1",gcr,"text",1);
gcr=GTK2.CellRendererText();
cols[2]=GTK2.TreeViewColumn("Val 2",gcr,"text",2);
gcr=GTK2.CellRendererToggle();
cols[3]=GTK2.TreeViewColumn("Active?",gcr,"active",3);
gcr->signal_connect("toggled",fixed_toggled,ts);
gcr=GTK2.CellRendererPixbuf();
cols[4]=GTK2.TreeViewColumn("Pic",gcr,"stock-id",4);
tree->append_column(cols[0])
->append_column(cols[1])
->append_column(cols[2])
->append_column(cols[3])
->append_column(cols[4]);
vb->add(tree);
w->signal_connect("destroy",lambda() { exit(0); },0);
w->show_all();
object path=GTK2.TreePath("1");
tree->set_cursor(path,cols[1],0);
return -1;
}