GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Precision of the data of GtkTreeViewColumn

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
hydra
Familiar Face


Joined: 23 Jan 2007
Posts: 35

PostPosted: Fri Jun 08, 2007 8:27 am    Post subject: Precision of the data of GtkTreeViewColumn Reply with quote

I use GtkTreeView to show some data in columns, the data has type G_TYPE_DOUBLE. The problem is that is see the numbers with the full precision. That means .000000 after the floating point. So, how can I specify the exact precision that i need?
Back to top
openldev
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 376
Location: State College, Pennsylvania

PostPosted: Fri Jun 08, 2007 12:08 pm    Post subject: Reply with quote

You must use a cell data function, which is called every time a row is created. You can control the precision with this. Basically, use gtk_tree_view_column_set_cell_data_func() to add a cell data function to a tree view column. Then, you can customize the displayed text in that function.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP