On Tue, 6 Mar 2001, James Henstridge wrote:

> On 5 Mar 2001, Lars Clausen wrote:
> 
>> 
>> I've looked a bit at making defaults dialogs from properties.  I see
>> three problems that need to be resolved:
>> 
>> 1) Should the defaults be object-specific or name-based?  I'd say
>>    name-based, but then we get the possibility of accidentally
>>    transferring defaults between sheets.  Is that going to be a problem?
>> 
>> 2) More serious:  Each property should have a default value.  If the
>>    defaults are name-based, there can only be one default value for any
>>    property of that name, which might not please everyone.
> 
> In most cases, we probably want per property rather than per object
> (eg. at the moment, default colours, line styles, line widths and fonts
> are shared between all types).  I am sure there are some cases where
> having things per object is useful as well.

Maybe we could have it be the combination of the name and the default value
that identifies a grouping?  And maybe I should check how many cases there
are of this before I do large nasty designs.

>> 3) How does an object specify the default value?  I'd like to add it to
>>    the PropDescription struct, but that would break binary
>>    compatability.  Adding another struct for this would be plain silly.
> 
> Well, at the moment PropDescription structs are static, whereas the
> default values for properties are mutable in dia.  Is this feature worth
> preserving?  How do we handle multiple objects types which should share a
> default, yet have separate (identical) PropDescription structs?

What do you mean, the default values for properties are mutable?  The only
default values currently used (except for the standard properties) are
hardcoded. 

> With the glib 2.0 GObject properties, there is a
> g_param_value_set_default() function that can be used to modify the
> default for a GParamSpec, so this sort of thing will be possible when we
> move over to gtk 2.0 (and I think you can share a single GParamSpec
> between multiple object types on different branches of the type tree,
> which would handle the shared defaults problem).

That does sound good.  I'm looking forward to it.

-Lars

-- 
Lars Clausen (http://shasta.cs.uiuc.edu/~lrclause) | Hårdgrim of Numenor
"I do not agree with a word that you say, but I    | Retainer of Sir Kegg
will defend to the death your right to say it."    |   of Westfield
    --Evelyn Beatrice Hall paraphrasing Voltaire   | Chaos Berserker of Khorne

Reply via email to