[gambit-list] How to pass a procedure to a nonnull-function?

Marc Feeley feeley at iro.umontreal.ca
Sun Nov 6 15:32:59 EST 2011

On 2011-11-04, at 10:06 AM, Vok Vojwo wrote:

> 2011/11/3 Marc Feeley <feeley at iro.umontreal.ca>:
>> The actual C callback needs to pass the "callback data" (the wrapped closure) to scheme-callback by calling scheme_callback.
> Thanks for the information. It was very useful to understand the
> Scheme-C interaction.
> But the problem is much bigger than I thought, because only simple Gtk
> callbacks require no parameters. There are many signals which want to
> pass arguments to the callback function. The delete-from-cursor of the
> entry widget is such a signal:
> http://developer.gnome.org/gtk3/stable/GtkEntry.html#GtkEntry-delete-from-cursor
> And because of that it would not help much to be able to call a Scheme
> function without arguments. It is necessary to convert all arguments
> to Scheme values and call a Scheme function from C. I think I have to
> follow the link Alex has posted. The problem can not be solved without
> the Gtk marshal functions.

You are not obligated to use void functions.  You can pass parameters and return results.  There must be one type of "scheme_callback" function for each signature however.


More information about the Gambit-list mailing list