Re: [Vala] Type of Gtk.Dialog.vbox




2008/4/8 Andrea Bolognani <eof kiyuko org>:
Hi everybody,

I recently started playing with Vala, and as an exercise I started porting
a simple GTK+ application to this language.

I noticed the vbox property of Gtk.Dialog is declared of type Gtk.Widget, so
if I want to add a widget to the dialog I have to explicitly cast it to
a Gtk.Container as in the code below

   ((Gtk.Container) dialog.vbox).add (label);

Is this the intended behaviour, or rather a bug in the GTK+ binding?

--
KiyuKo <eof AT kiyuko DOT org>
Resistance is futile, you will be garbage collected.


From what I know, this is the Gtk API.

Since about every 'struct' in GObject needs to be converted before you get access to the extended/base class features, this looks like little overhead when using GtkDialog->vbox in C.

However, this interface seems strange from a language with built-in oop such as Vala.

Mind you, it doesn't impose no overhead at runtime.

Vlad


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