On Wed, Apr 15, 2009 at 4:22 PM, pancake <[email protected]> wrote:
> lambdas can be used with .connect() ?
Just place the full lamba expression in the brackets.
var button = new Button.with_label ("Click me!");
button.clicked += (source) => {
source.label = "Thank you";
};
becomes:
var button = new Button.with_label ("Click me!");
button.clicked.connect ((source) => {
source.label = "Thank you";
});
Gr,
Thijs
> is there any disconnect_all() or so?
>
> Jürg Billeter wrote:
>>
>> The syntax for connecting and disconnecting signal handlers using += and
>> -= has been inherited from the C# syntax. As described in bug 566847
>> [1], using these operators does not seem appropriate for signals.
>> Therefore, the syntax has now been deprecated by
>>
>> foo.clicked.connect (handler);
>> foo.clicked.disconnect (handler);
>>
>> The old syntax still works and will continue to be supported for the
>> foreseeable future to not break existing code. A future compiler version
>> might print a warning when not using --enable-deprecated.
>>
>> Jürg
>>
>> [1] http://bugzilla.gnome.org/show_bug.cgi?id=566847
>>
>> _______________________________________________
>> Vala-list mailing list
>> [email protected]
>> http://mail.gnome.org/mailman/listinfo/vala-list
>>
>
> _______________________________________________
> Vala-list mailing list
> [email protected]
> http://mail.gnome.org/mailman/listinfo/vala-list
>
_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list