[comp.windows.x.motif] Resources defined both in CORE and RECTOBJ

kdg@world.std.com (Keith D Gregory) (11/26/90)

Resources such as XmNancestorSensitive, XmNx, et al, are defined both
as belonging to Core and RectObj (Programmer's Reference, Rev 1.0).

My question is: Are these really defined for both widget classes, or
is it a documentation quirk?

My feeling is that they are defined twice, so that XmGadget inherits
from RectObj, but Core has its own.  This feeling comes from slight
differences in the documentation for these resources.

So, what is the answer?  Is it a documentation quirk or a design point.
Any background would certainly be helpful for my purposes.

Please mail to me and I'll summarize.
Thanks,
-kdg

marbru@attc.UUCP (Martin Brunecky) (11/27/90)

In article <1990Nov25.203108.25166@world.std.com> kdg@world.std.com (Keith D Gregory) writes:
>
>Resources such as XmNancestorSensitive, XmNx, et al, are defined both
>as belonging to Core and RectObj (Programmer's Reference, Rev 1.0).
>
>My question is: Are these really defined for both widget classes, or
>is it a documentation quirk?
>
    History and upwards compatibility.
    Remember R2 had no notion of objects, it only had "core".
    When they broke it up in R3 (core into object, rectObj and windowObj)
    they did NOT introduce the true subclassing as they (arguably) should.
    The true subclassing would break anybody's code accessing fields like
    w->core.x (it would have to be changed into w->object.x).

    So instead of having a class hierarchy with ONE root (object), we
    have class hierarchy with TWO roots (object and core), which *happen*
    (purely intentionally) to overlap in appropriate fields. Both for
    class and instance records.

    Thus, the resources above are REALLY defined for multiple widget
    classes. Just as with any other resources you must watch what
    resources are defined for a particular class; i.e. XtNx does not
    apply to "objectClass". Also note that the same resource *name*
    may apply to different widgets and may even have a (slightly?)
    different meaning. This normally should not happen in a consistent
    toolkit such as Motif, but as you start collecting widgets from
    different sources you may (and will) run into conflicts.

    One may wonder why "sensitive" and "ancestorSensitive" are defined
    for "rectObj", as both have mostly INPUT related semantics (which
    only "core" can deal with). But it was usefull for Gadgets, where
    the whole breakdown originated - so be it.

-- 
=*= Opinions presented here are solely of my own and not those of Auto-trol =*=
Martin Brunecky [BORN TO BASH UIL]                  marbru@auto-trol.COM
(303) 252-2499                                 {...}ncar!ico!auto-trol!marbru
Auto-trol Technology Corp. 12500 North Washington St., Denver, CO 80241-2404