Re: On object types



Thu Jul 2 08:58:39 +0200 1998 Didimo Emilio Grimaldo Tunon <emilio_tunon@nl.compuware.com> wrote:
> 
>   A simple question, do all the widgets have to be declared as GtkWidget *
>   or is that merely a convenience? I mean, is it valid to declare an
>   entry widget as such, i.e.
> 
>   		GtkEntry *oneEntry;
> 
>   the reason for the question is that I see a lot of casting being
>   used like GTK_ENTRY(oneEntry) and wonder if so much programmatical
>   orthopedics is actually needed. Answers anybody?

At run time, the program does not know what type of the pointer variable is
and therefore it is up to programmer to use what type s/he wants. I think
the GtkWidget *  is considered as abstract gtk widget variable.

The GTK_ENTRY(oneEntry) is needed even the variable is declared as of type
GtkEntry * since at development phase, that GTK_ENTRY() macro is capable
of doing a runtime checking to the variable that it is having a right type.

> 
>   		Cheers,
> 			Emilio

Tomi



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