Skip to content

minigui docs: event handler must be a delegate #475

@whitebyte

Description

@whitebyte

https://dpldocs.info/experimental-docs/arsd.minigui.Event.html

Trying to actually compile an example from this page

widget.addEventListener((KeyDownEvent ev) { ... }, /* optional arg */ useCapture );

throws arsd/minigui.d(1416): Error: static assert: "Your handler wasn't usable because it wasn't passed a delegate. Use the delegate keyword at the call site."

Marking lambda as a delegate solves the issue:

widget.addEventListener(delegate(KeyDownEvent ev) { ... }, /* optional arg */ useCapture );

no biggie but it's worth mentioning in the docs.
Also, useCapture isn't documented anywhere

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions