[Vala] How to chain up to parent constructor
- From: Dov Grobgeld <dov grobgeld gmail com>
- To: vala-list gnome org
- Subject: [Vala] How to chain up to parent constructor
- Date: Fri, 1 Jan 2010 12:13:16 +0200
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]