Hi there,

I try to do the following in Vala without much success :

namespace Test {

    public class Popup {

        public void create (Callback action_callback) {

                Gtk.Action action = new Gtk.Action ("", "", "", null);

                action.activate.connect (action_callback);

        }
    }
}


Then :

Test.Popup test = new Test.Popup ();
test.create ((Callback) _test_template);

I get "Cannot convert from GLib.Callback to Gtk.Action.activate", I tried also with (void *), or Gtk.ActionCallback
but I also get compilation errors.

Any idea ?

If I'm doing this, of course it works :

namespace Test {

    public class Popup {

        public void create (Callback action_callback) {

                Gtk.Action action = new Gtk.Action ("", "", "", null);

                action.activate.connect (_test_template);

        }
        private void _test_template (Gtk.Action action) {
        }
    }
}

But I try to add some actions dynamically so I'd like to pass the callback as an argument.

What I'm doing wrong ?

:)

--
Axel FILMORE

_______________________________________________
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to