Re: question about instancing variables
- From: David Nečas <yeti physics muni cz>
- To: Teste123 Teste123 <asb1231 gmail com>
- Cc: gtk-list gnome org
- Subject: Re: question about instancing variables
- Date: Wed, 27 Jan 2010 16:24:34 +0100
On Wed, Jan 27, 2010 at 01:18:22PM -0200, Teste123 Teste123 wrote:
> All GTK+ codes that I see all variables are GtkWidget and after transformed
> for the widget. Example:
>
> GtkWidget *button;
>
> button = gtk_ button_new();
>
> Why not directly:
>
> GtkButton *button;
The constructors return GtkWidget*.
It can be discussed endlessly whether they should return GtkWidget* or
the specific type, anyway, you would have to do lots of typecasting in
both cases and this is simply the way it is.
Yeti
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]