> Date: Mon, 7 Jun 93 10:16:40 MDT
> From: Scott Raney <starnet!apple!metacard.com!raney>
> Subject: Inherited properties in MetaCard
>
>
> In the 1.2 and earlier releases of MetaCard, when you get a
> display-attribute property (colors and fonts) that hasn't been set for
> a particular object, empty is returned. When the object is actually
> drawn, however, it uses the attributes of its parent (which in turn
> may be inherited).
>
> The question: should the object return empty in these cases, or go and
> fetch its parent's attributes?
It seems reasonable to me for empty to be returned for the API. The
script COULD find the inheritance source by itself, right? (using
SENDs)
One instance in the MetaCard interface where this behavior is
apparently causing a problem is in setting text attributes from
the menu bar. If the default font, size, style or color are inherited
for a section of text, then the text attributes aren't indicated in the
menus. (This occurs even if the text attributes are set from the
menu bar, but remain the same as the inherited attributes.)
>From a scripting standpoint, I don't believe that the programmer
will typically be concerned with whether a property is inherited.
But then again, you never know. I'd suggest that, inherited or
otherwise, the value of properties always be returned. I'd also
suggest the addition of a function that returns the value of a
property, whether the property was inherited, and if so, the
object the property was inherited from.
Would this behavior be changed for all inheritable properties, or
just the display attribute properties for text? Thinking about the
question in the context of the MetaCard interface, I'd like to see the
values of inherited properties on the "object font" and "object colors"
dialogs, instead of blank fields. But then again, I'd certainly want to
know when the properties were inherited instead of set explicitly
for the object in question.
>From a NON scripting standpoint the distinction is more important. A
stack author (non-scriptor) may wish to set fonts at different levels
to enforce consistancy. They need to be able to see where it was
inherited from (if at all). The lack of a clear indication of the
inheritance has caused us grief in the past.
I like the idea of indicating both inherited value and inheritance
source in the dialogs. I agree that this is important for FONT and
COLORS but NOT just for text properties. I've had the same concern for
fonts and colors of buttons.
-Pothier-