[Vala] Signal connection confusion
- From: Frederik <scumm_fredo gmx net>
- To: vala-list <vala-list gnome org>
- Subject: [Vala] Signal connection confusion
- Date: Mon, 29 Jun 2009 18:34:02 +0200
Hi,
why do callbacks A, C and D connect to the signal but B doesn't? What
are the rules?
Best Regards,
Frederik
public class Foo : Object {
public signal void some_event (int x, int y);
public void method () {
some_event (42, 4711);
}
public void callback_a (Foo source, int x, int y) {
stdout.printf ("Callback A\n");
}
public void callback_b (Foo source, int x) {
stdout.printf ("Callback B\n");
}
public void callback_c (int x, int y) {
stdout.printf ("Callback C\n");
}
public void callback_d (int x) {
stdout.printf ("Callback D\n");
}
}
static int main (string[] args) {
var foo = new Foo ();
foo.some_event.connect (foo.callback_a);
foo.some_event.connect (foo.callback_b);
foo.some_event.connect (foo.callback_c);
foo.some_event.connect (foo.callback_d);
foo.method ();
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]