Re: How to create a variable of the <gint*> type?

Andy Wingo <[email protected]>
Newsgroups gmane.lisp.guile.gtk
Message-ID <[email protected]>
Hi Milan,

On Mon, 2006-01-09 at 01:09 +0100, Milan Zamazal wrote:
> In my scheme code I need to call a guile-gnome function
> (`window-to-buffer-coords') that requires arguments of the type <gint*>.
> But I couldn't find a way how to create a variable of that type.  Could
> you help me please?

This type no longer exists in Scheme. Consider a function like the
following:

  gboolean gtk_icon_size_lookup (GtkIconSize size, gint *w, gint *h);

The gint* is a C way of providing for multiple return values. In Scheme
we can do better, returning multiple values directly. The bindings
generator automatically recognizes int* arguments as output arguments;
that is, it is expected that gtk_icon_size_lookup will initialize them,
and the wrapper returns those values. The same happens with any other
scalar argument, such as gboolean*, or GQuark*.

There are cases in which the * indicates something else, however, for
example an array. In those cases, we have to wrap the functions
manually. However in the GTK+ API, the *-as-output-argument idiom is
much more common.

Regards,

Andy.
-- 
http://wingolog.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.