Handling CheckBox state changes in DLangUI

Daren Scot Wilson darenw at darenscotwilson.com
Sat Dec 31 04:07:36 UTC 2022


On Saturday, 31 December 2022 at 03:05:45 UTC, brianush1 wrote:
> On Saturday, 31 December 2022 at 02:40:49 UTC, Daren Scot 
> Wilson wrote:
>> The compiler errors I get are, for no '&' and with '&':
>>
>> Error: function `app.checkbox_b_clicked(Widget source, bool 
>> checked)` is not callable using argument types `()`
>>
>> Error: none of the overloads of `opAssign` are callable using 
>> argument types `(bool function(Widget source, bool checked))`
>
> Try:
>
>     import std.functional : toDelegate;
>     check_c.checkChange = toDelegate(&checkbox_b_clicked);

That works :)



More information about the Digitalmars-d-learn mailing list