[gtk-server] Re: gtk-server Digest V5 #3

  • From: Peter van Eerten <administrator@xxxxxxxxxxxxxx>
  • To: gtk-server@xxxxxxxxxxxxx
  • Date: Fri, 05 Sep 2008 16:41:49 +0200

Quoting Erik Winkels <euqirea@xxxxxxxxx>:

Date: Fri, 05 Sep 2008 13:08:45 +0200
From: Peter van Eerten <administrator@xxxxxxxxxxxxxx>
Subject: [gtk-server] Re: List Activity

Thanks Peter, that worked (except I always have to define DOUBLEs instead of FLOATs for some reason to make things work).

I have the same issue on my 64bit system. Can you please send me the output of the following:

echo "gtk_server_ffi" | gtk-server -stdin
echo "gtk_server_version" | gtk-server -stdin
uname -a

According to thise tutorial there is:

    - http://scentric.net/tutorial/sec-treeview-celltext-types.html
    - http://scentric.net/tutorial/sec-treeview-col-celldatafunc.html

but I don't see how I can do that from gtk-server.

This is a tricky one. It means you have to preformat the string with libc-like functions. In the latest configfile this library is defined. For me, the following sequence worked:

peter@host:~$ gtk-server -stdin
gtk_server_define sprintf NONE NONE 3 WIDGET STRING DOUBLE
sprintf 7301168 "%.2f" 1.234
gtk_server_define printf NONE NONE 2 STRING WIDGET
printf "%s\n" 7301168

This should also be possible with 'g_snprintf', of course. As you can see, the 'sprintf' call will put it's result in a WIDGET, for which we claim memory with 'gtk_server_opaque'. After the 'sprintf' call, the WIDGET pointer will contain the result. This result can be printed with a 'printf'. Also the WIDGET pointer can be used in the g_object_set call:

g_object_set(renderer, "text", WidgetID, NULL);

Make sure libc is defined in your configfile. If it is not, you can define it on the fly with

gtk_server_require libc.so.6

Hope this helps!

Other related posts: