[gtk-server] Re: Using GTk macros or properties

  • From: Peter van Eerten <administrator@xxxxxxxxxxxxxx>
  • To: gtk-server@xxxxxxxxxxxxx
  • Date: Wed, 8 Jun 2005 18:23:18 +0200

Hi Philippe,

If you want to use GTK functions, please make sure the 'gtk-server.cfg' file is
updated accordingly with the functions you want to use. If the functions you use
are not mentioned here, the GTK-server will return a '-1'.

That would mean that 'GTK_WIDGET_VISIBLE' must be added to the configfile as
well. Still, if you do so, the GTK-server will complain that it cannot find this
call in the GTK libraries.

So in the end your suspicion is right: the 'GTK_WIDGET_VISIBLE' function is not
really a function, but it is a C macro. There is no way for the GTK-server to
reach such a macro, since it uses 'dlopen()' to import C-functions from

For now, I would propose 2 ways of workaround this problem.

1) Use the GTK-function 'gtk_widget_get_child_visible ()'. If you know the
parent widget (probably a container, a box, or a table) you can use this
function to retrieve the child's status. You have to add it also to the
GTK-server configfile; it is not in there yet.

2) Keep track in your client program if a widget has been shown in the past
already, or not. So administer the status per widget (in a list for example) and
query this list for the status of the widget.

Hope this helps,

Citeren Philippe Lorin <palpalpalpal@xxxxxxxxx>:

> I'm trying to determine whether a given widget is visible. I found
> this in the GTK docs:
> 1. GTK_WIDGET_VISIBLE() (which is a macro)
> 2. The "visible" property
> (source: http://developer.gnome.org/doc/API/2.0/gtk/GtkWidget.html)
> But I can't get these to work. I believe it's because they are not
> functions; I've only used functions (e.g. gtk_window_set_title) until
> now. I tried various ways of writing my GTK-server call but all I got
> as a result was -1, regardless of the widget's visibility -- the same
> as when I write rubbish.
> Can somebody give me an example for using these? I'm new to both
> GTK-server and GTK, so don't hesitate telling me obvious stuff. I'm
> using CLisp with Linux.


Other related posts: