Re: construct-time properties and constructor



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.
> 
> evolution.
> 
> > 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,
>      appbar->temp_has_progress,
>      appbar->temp_has_status,
>      appbar->temp_interactivity);

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.
clist does.
this is not an API break however (except for making the _construct() functions
finally private) if you mark those object fields private.

---
ciaoTJ




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