[comp.windows.x.motif] Certain resources

argv@Eng.Sun.COM (Dan Heller) (09/24/90)

Cetain widgets in the Motif widget set have a separate resource
list call XmSyntheticResources that says is for "resources that
need special processing in get values".   I don't know how it
works yet, but that's how they do the conversion between units,
also.  (All widget internal units are in pixels, but you can set
and get resources in the units you choose.)

For the Label widget's labelString resource, this resource
list calls GetLabelString, which calls _XmStringCreateExternal,
which returns a copy of the XmString  in the label.  Contrary
to how GetValues works for most widgets (you are returned a
pointer to the actual internal data pointer), you must *free*
this value or you get a memory leak.

Why is this done so much?  And for which explicit resources
is it done on?  And where in the motif doc does it discuss
this?  And, for performance reasons, how can I prevent this
fromk happening?

It would be so nice if someone could provide a discussion of
some kind that addresses this and related questions.

--dan