[Vala] How to chain up to parent constructor



How do you create a "transparent" inheritance? E.g. I would like to inherit
from Gtk.RadioToolButton and support all its methods and constructors.

But when creating the proxy class FooRadioToolButton below I get the error
"The name `from_stock' does not exist in the context of
`FooRadioToolButton'" though from_stock exists in Gtk.RadioToolButton. What
did I do wrong?

Here's my entire program that doesn't compile:

using Gtk;

public class FooRadioToolButton : Gtk.RadioToolButton {
}

public class MyApp : Gtk.Window {
    construct {
        this.destroy += Gtk.main_quit;
        var toolbar = new Toolbar();
        var slist = new SList<Gtk.Widget> ();
        var radio1 = new FooRadioToolButton.from_stock(slist,
Gtk.STOCK_EXECUTE);
        radio1.show();
        toolbar.insert(radio1, -1);
        toolbar.show();
        this.add(toolbar);
    }

}

int main(string[] args) {
    Gtk.init(ref args);

    var app = new MyApp();
    app.show_all();

    Gtk.main();
    return 0;
}

Thanks!
Dov


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