If you put a float in a treeview, you get a really long decimal, which is almost always not desired. So, after playing around with it for a while, I came up with this code to truncate floats at 1 decimal place: column.set_cell_data_func(renderer, lambda column, cell, model, iter: cell.set_property('text', '%.1f' % model.get_value(iter, column.get_sort_column_id())))
The problem with this is that it uses GtkTreeViewColumn::get_sort_column_id() to get the column number, which only works if the column is sortable. Can anyone tell me what to do if I want the formatting to work on any column, not just sortable columns? Thank you. _______________________________________________ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/