Re: construct-time properties and constructor



On 13 Nov 2001, Murray Cumming wrote:

> I'm trying to fix the libgnomeui widgets so that they use construct-time
> properties instead of _construct functions, but I'm finding that most of
> properties would need to be dealt with all at once, instead of one after
> the other.
> 
> It seems like this might be possible in the widget's constructor, which
> gets passed an array of construct-time properties. But I am concerned
> that these will be set a second time by the normal properties system.
> Should I remove them from the GObjectConstructParam
> *construct_properties array and pass a different array to the parent
> class's constructor to stop this?
> 
> Although I've read about this in the archives, I can't seem to find an
> example of a constructor that actually uses the construct_properties
> array that's passed to it.

you shouldn't actually touch that array.
just pass the array on when chaining to the parent class' constructor.
then perform any construction tasks after chaining.
to disable setting of these properties after the object has been
constructed, create them with the G_PARAM_CONSTRUCT_ONLY flag.

> 
> -- 
> Murray Cumming
> murrayc usa net
> www.murrayc.com
> 

---
ciaoTJ





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