How to set format in GtkTreeView

65c2af8f39e36a746e71caa597922000.png
1. create
GtkTreeView
with the
GtkTreeViewColumn
and
GtkCellRendererText
as normal;
2. connect the
GtkTreeViewColumn
to the
GtkTreeViewColumn::set_cell_data_func
callback;
3. in the callback, get value from model that you want to format;
4. format the value as you want;
5. set text back via
GtkCellRendererText::set_property('text', $new_value);