Re: [Vala] How to chain up to parent constructor
- From: Abderrahim Kitouni <a kitouni gmail com>
- To: Dov Grobgeld <dov grobgeld gmail com>
- Cc: vala-list gnome org
- Subject: Re: [Vala] How to chain up to parent constructor
- Date: Fri, 1 Jan 2010 12:03:15 +0100
Hi,
2010/1/1 Dov Grobgeld <dov grobgeld gmail com>:
How do you create a "transparent" inheritance? E.g. I would like to inherit
from Gtk.RadioToolButton and support all its methods and constructors.
short answer: you cannot ;-)
Long answer, you can transparently inherit methods, but for
constructors it is more complicated : You need to explicitly write
constructors, and chain up (btw, you cannot always chain up to a
constructor, and you're not obligated to chain up to the direct base
constructor).
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?
as I explained earlier, constructors aren't inherited, you need to
explicitly write a constructor, and I think you cannot chain up to
RadioToolButton's constructor, you need to write a constructor and
chain up to Object, setting the needed property.
HTH,
Abderrahim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]