On 10 January 2013 16:57, Jonathan Ballet <j...@multani.info> wrote: > Hi, > > I tried to customize a Gtk.TreeColumn by setting a "cell data function" > to convert the value from my model to something more useful for my > renderer (converting a path nam to an actual pixbuf). > > It wasn't working so I tried more or less the same with a much simpler > model, but it still doesn't work. This is basically what I tried: > > def cell_data_func(column, cell, model, iter, data): > cell.set_property('text', model.get(iter, 0)) > > store = Gtk.ListStore(str) > view = Gtk.TreeView(store) > > column = Gtk.TreeViewColumn("Value") > renderer = Gtk.CellRendererText() > column.set_cell_data_func(renderer, cell_data_func) > view.append_column(column) > > ...
You're not adding your CellRenderer to the column (something the TreeViewColumn helpfully does automatically). You need something like column = Gtk.TreeViewColumn("Value") renderer = Gtk.CellRendererText() column.pack_start(renderer, True) column.set_cell_data_func(renderer, cell_data_func) and so forth -- Neil Muller drnlmul...@gmail.com I've got a gmail account. Why haven't I become cool? _______________________________________________ python-hackers-list mailing list python-hackers-list@gnome.org https://mail.gnome.org/mailman/listinfo/python-hackers-list