Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DClosure implementation #225

dhasenan opened this issue Jan 7, 2018 · 1 comment

DClosure implementation #225

dhasenan opened this issue Jan 7, 2018 · 1 comment


Copy link

dhasenan commented Jan 7, 2018

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.

Copy link

MikeWey commented Jan 7, 2018

It look like we need to implement a marshal function to translate an array of GValues into a D function/delegate call. And add a DClosure to hold the function pointer/delegate.

@MikeWey MikeWey self-assigned this Jan 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants