On Wednesday, 22 May 2019 at 23:54:47 UTC, Adam D. Ruppe wrote:
On Wednesday, 22 May 2019 at 22:33:52 UTC, Alex wrote:
auto x = (GdkEventButton* e, Widget w) ...
X.addOnButtonPress(x);
Why is x not a delegate?
Because you didn't ask for one and it didn't have to be.
Just add the dele
On Wednesday, 22 May 2019 at 22:33:52 UTC, Alex wrote:
auto x = (GdkEventButton* e, Widget w) ...
X.addOnButtonPress(x);
Why is x not a delegate?
Because you didn't ask for one and it didn't have to be.
Just add the delegate keyword to ask for one:
auto x = delegate(GdkEventButton* e
On Wed, May 22, 2019 at 10:33:52PM +, Alex via Digitalmars-d-learn wrote:
> In gtkD one can use a lambda directly:
>
> X.addOnButtonPress((GdkEventButton* e, Widget w) ...
>
> but if I try move the lambda in to a variable so I can use it with
> multiple handlers, I get an error:
>
>
In gtkD one can use a lambda directly:
X.addOnButtonPress((GdkEventButton* e, Widget w) ...
but if I try move the lambda in to a variable so I can use it
with multiple handlers, I get an error:
// x is a function and does not work
auto x = (GdkEventButton* e, Widget w) ...
X.a