Re: GtkListStore and G_TYPE_FLOAT



Hi.

I think there is no way of specifying the number of decimal places in
GtkCellRendererText. So one solutions you've already mentioned is to
add additional G_TYPE_STRING column with floats converted to strings.
The other would be to use cell data function which would transform
floats on the fly.

Sample data function can be seen here:
http://scentric.net/tutorial/sec-treeview-col-celldatafunc.html


2009/1/18 Harinandan S <harinandans gmail com>:
> Hi All,
> When I create a list store to store float with G_TYPE_FLOAT, and view it in
> GtkTreeView, the number of significant digits after decimal points is around
> 6. My data have a max of 2 digits after decimal point and hence it looks bad
> in GtkTreeView. Is there any way to set the number of digits after decimal
> point or I've to use G_TYPE_STRING and convert float to string and vice
> versa?
> Regards,
> Harinandan S
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>
>



-- 
Tadej Borovšak
tadeboro gmail com
tadej borovsak gmail com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]