Hello

I've been trying to create an IUP language binding for the Crystal
language[1]. What I've got so far works fine, however, I haven't been
able to bind `IupSetCallback` or `IupSetCallbacks` in an idiomatic way.

I created a post on the Crystal forums about this[2], the summary is
that: to have this work in a "nice" way, either the original C function
needs to have a `void* data`-type argument that can be used[3], or I
create a singleton class which stores all the (Crystal) callbacks and
looks up the appropriate one when writing the (C) callback.

While the first option doesn't seem possible (considering it'd
probably be a breaking change with no benefit), is there some way in
IUP that I can use to be notified when the set callback isn't needed
anymore as the control/dialog isn't either?

Thanks,
Ben

[1]: https://crystal-lang.org

[2]: https://forum.crystal-lang.org/t/c-binding-non-void-callback/2079

[3]: similar to `gpointer data` for `g_signal_connect_data()` in Gtk
     
https://developer.gnome.org/gobject/stable/gobject-Signals.html#g-signal-connect-data


_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to