Skip to content

DClosure implementation #225

Description

@dhasenan

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions