Re: GdkColor weird type? Why not pointer like GtkWidget*....
- From: Daniel Elstner <daniel elstner gmx net>
- To: rsteinke w-link net
- Cc: seberino spawar navy mil, gtk-list gnome org
- Subject: Re: GdkColor weird type? Why not pointer like GtkWidget*....
- Date: 22 Apr 2002 21:28:33 +0200
Am Mon, 2002-04-22 um 19.53 schrieb rsteinke w-link net:
>
> It really an extern "C" struct with four members.
> Since it's extern "C", you need to initialize it
> in the proper C (_not_ C++) way. For a struct in C,
> you provide an initialization list for the members,
> e.g.
>
> GdkColor color = {0, 0, 0, 0};
>
> If you provide fewer initializers than there are members,
> the last initializer is used to initialize all remaining
> members, so
>
> GdkColor color = {0};
>
> is equivalent.
>
> Just because you're initializing GdkColor in C++ doesn't
> mean you can treat it like a C++ class. It's still a
> C struct.
This has absolutely _nothing_ to do with C++ or extern "C". C++
supports constructors as alternative way to do the initialization, but
it's not a requirement.
--Daniel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]