Custom GTK2.CellRenderer?

Chris Angelico <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Message-ID <CAPTjJmra7vvW6HXnub+63xXg2rKTWf_uaeh0ihWA1aAQzCCgPA@mail.gmail.com>
I'm trying to write a manipulating version of GTK2.CellRendererText,
and for now am just trying to get a handle on the render process. This
code achieves nothing:

class LoggingCellRenderer
{
    inherit GTK2.CellRendererText;
    mixed render(mixed ... args)
    {
        write("render(%O)\n",args);
        return ::render(@args);
    }
}

int main()
{
    GTK2.setup_gtk();
    object ls=GTK2.ListStore(({"string"}));
    foreach (({"foo","bar","-- New --"}),string kwd)
ls->set_value(ls->append(),0,kwd);
    GTK2.Window(GTK2.WindowToplevel)->add(GTK2.TreeView(ls)
        ->append_column(GTK2.TreeViewColumn("Item",LoggingCellRenderer(),"text",0))
    )->show_all()->signal_connect("destroy",lambda() {exit(0);});
    return -1;
}

The write() call never happens; the overridden render() is never
called. Is there a way to hook into this sort of thing via
inheritance?

ChrisA
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.