[gtk-server] Re: Formatting floats (Was: gtk-server Digest V5 #3)

  • From: Peter van Eerten <administrator@xxxxxxxxxxxxxx>
  • To: gtk-server@xxxxxxxxxxxxx
  • Date: Mon, 08 Sep 2008 21:58:04 +0200

Hi Erik,

I'm going to let this issue rest for a while as I don't think your last
set of solutions was very optimal

That was intentionally. The idea is that people learn the most when they discover the solution themselves ;-) Secondly, during the day I can not spend much time as I have a job also.

But tonight I fiddled around with the examples on the "http://scentric.net/tutorial/sec-treeview-col-celldatafunc.html"; tutorial, on which I based my last answer, and guess what? It doesn't seem to work, not even in C, as far as I am able to reconstruct the original C-program from the pieces of code on the website. :-(

Now, I would like to turn your question around. If you are able to provide me with a working and compilable C-example of the functionality you need, I will provide you with an implementation using the GTK-server. How does that sound?

I still think gtk-server providing a pointer to a function for handling
the decimals would be the best solution, something like:

    > gtk_server_decimals_cell_data_func 2
    1098432
    > gtk_tree_view_column_set_data_func col renderer 1098432 NULL NULL
    ok

Where the argument to gtk_server_decimals_cell_data_func is the amount
of decimals you want to display.  So it would return different pointers
for different arguments.

Wouldn't that lead to an endless amount of functions? Because, people do not only want 2 or 3 or 4 decimals, also for Floats and Doubles, and maybe the CellRenderer does not render text but a picture? Can we setup color depth, picture size, cropping also? With INT or LONG values, should we display a separation for thousands and millions? The amount of possibilities to format the layout of text and other types of information is endless...?

I am sorry I cannot help you further right now, but I would be happy to see any C-program which demonstrates your requests. If you are able to obtain the code in C (so not with some Python or Perl binding, because who knows what code has been added to that interface), please send it to me!

Thanks and greetings
Peter

--
http://www.gtk-server.org


Other related posts: