Re: construct-time properties and constructor
- From: Tim Janik <timj gtk org>
- To: murrayc usa net
- Cc: gtk-devel-list <gtk-devel-list gnome org>
- Subject: Re: construct-time properties and constructor
- Date: Wed, 14 Nov 2001 01:47:05 +0100 (CET)
On 14 Nov 2001, Murray Cumming wrote:
> On Wed, 2001-11-14 at 00:39, Tim Janik wrote:
> > > So how can I get at that information? Should I use struct member fields which are set in set_property(), then read in those temporary values in the constructor after calling the base constructor?
> > hm, adding newlines helps making the message text more digestible.
> > if with struct member fields you mean object fields, then yes.
> Yes, I mean a constructor like this:
> static GObject*
> gnome_appbar_constructor (GType type,
> guint n_construct_properties,
> GObjectConstructParam *construct_params)
> GObject *object = 0;
> GnomeAppBar *appbar = 0;
> /* Call base class's constructor: */
> /* This will set the temp_* values in set_property() */
> object = (* G_OBJECT_CLASS (parent_class)->constructor) (type,
> appbar = GNOME_APPBAR(object);
> _gnome_appbar_construct (appbar,
you're missing return object; here
> I guess we have to break the API on libgnomeui so that we have somewhere to temporarily
> store these construction parameters.
usually construct properties correspond to values set in an object structure.
i don't know about all the libgnomeui constructors, but that's what e.g.
this is not an API break however (except for making the _construct() functions
finally private) if you mark those object fields private.
] [Thread Prev