There are a number of API functions that accept a gobject.Closure and don't accept a function/callback pair. For example, gtk.AccelGroup.AccelGroup.connect. A few problems with this:
- D's type system doesn't let me use
gobject.CClosure in these locations.
- The natural way to write these in D is with a delegate. This isn't an option here.
- I can't access parameters with a
gobject.CClosure in any obvious way.
- I have to cast from eg
void function(void* context) to void function(), which is not type-safe.
It would be great to add a way to create an appropriate Closure object.
There are a number of API functions that accept a
gobject.Closureand don't accept a function/callback pair. For example,gtk.AccelGroup.AccelGroup.connect. A few problems with this:gobject.CClosurein these locations.gobject.CClosurein any obvious way.void function(void* context)tovoid function(), which is not type-safe.It would be great to add a way to create an appropriate
Closureobject.