[Vala] Signal connection confusion



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]