You cannot pass a Ren-C function as a callback. C does not know how to call Ren-C functions without the rebXXX() wrapping.
What you can do is create a C function...pass that as a callback, and use the Ren-C API inside the C function.
I feel I have said something in this vein before.
Yes, I had already figured that out, I am now in the process of getting the C function callback do exactly that.
And I had that working too, but I think I had it working with some unsaved code on top of it that I did save to commit a change and now I can't get the working version reconstructed.
(The callbacks are working but passing the function or block and rebElide that does not and is very likely to exit the console)
// Signal helper C
static void self_signal_connect_helper(GtkWidget *widget,
gpointer user_data){
rebElide("print {Inside self_signal_connect_helper}");
rebElide("print {before rebElide of user_data}");
rebElide(user_data);
rebElide("print {After rebElide of user_data}");
return;
}
And setting this in g-connect-signal-data
result = g_signal_connect_data(instance, detailedsignal, G_CALLBACK(self_signal_connect_helper), chandler, NULL, flags);
gtk-main
Inside self_signal_connect_helper
before rebElide of user_data
Segmentatiefout (geheugendump gemaakt)
Probably need to cast the chandler to the data format, but somehow this was the change that made the thing work (apparently).