[Vala] bug in new signal connect syntax



Hi
I started to convert my application from old "xx += callback;" signal
connection syntax to "xx.connect(callback);" style.
Unfortunately I found many vala errors when trying to compile. Seems to
be an issue with type checking for the callback's classes.
I attached a testcase to this mail.
Please check if this is really a bug or if I am doing something wrong.
I tested with latest git version of vala.
Regards
Jörn


valac --pkg gtk+-2.0 tv_signals.vala 
tv_signals.vala:5.30-5.50: error: Argument 1: Cannot convert from
`Browser.on_row_activated' to `Gtk.TreeView.row_activated'
                this.row_activated.connect(this.on_row_activated); 
                                           ^^^^^^^^^^^^^^^^^^^^^

using Gtk;

public class Browser : TreeView {
        public Browser() {
                this.row_activated.connect(this.on_row_activated); 
        }

        private void on_row_activated(Browser sender, TreePath treepath,
TreeViewColumn column) {
        }

        public void testfunction() {
                print("test\n");
        }
        
        public static int main(string[] args) {
                var b = new Browser();
                b.testfunction();
                return 0;
        }
}



Attachment: tv_signals.vala
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]