Hi,
Don't take my word on this, but perhaps it can help you.
In GTK C you would do gtk_tree_view_column_set_cell_data_func ()
http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeViewColumn.html#gtk-tree-view-column-set-cell-data-func
It seems this is not wrapped yet. The only events you can catch in the
CellRenderer are "editing-started", "editing-canceled" and "edited", so
a Listener won't help you either.
So perhaps the simplest solution at the moment, is that you create a
DataColumnString along with the DataColumnDouble, so you save the double
value in the double column and save the formatted text in the string
column. Then just show the formatted text column instead of the double
column. Use the editing-started and edited events to format the text for
editing and for keeping the DataColumnDouble up to date in case you make
the CellRenderer editable.
Hope this helps.
See you.
Damian Minkov wrote:
> I'm using Treeview and a DoubleColumn in it.
> I want to format the numbers to be 2 digits after the point.
>
> Any suggestions ?
|