Re: [gtk-list] parent_class
- From: Paolo Molaro <lupus lettere unipd it>
- To: GTK Mailinglist <gtk-list redhat com>
- Subject: Re: [gtk-list] parent_class
- Date: Sat, 10 Jan 1998 12:39:41 +0100
On Fri, Jan 09, 1998 at 02:15:46PM +0100, Sascha Ziemann wrote:
> Hi,
>
> most widgets define such a var in the *.c file:
>
> static GtkWidgetClass *parent_class = NULL;
>
> and some (togglebutton) do not. Why?
>
> The _Gtk*Class struct contains a parent_class var and ofter there is the
> static var in the *.c files. Why are there two parent vars?
You can override the virtual methods in the base class: to do so
you overwrite the pointers int the Gtk*Class structs (it's a copy
of the base class's structure).
If you want to call a method in the base class you need to keep a
pointer to the base class's structure (ie not to the *copy* in your
widget's class struct) and hence the static GtkWidgetClass *parent_class.
lupus
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]