[comp.windows.x] chaining resource converters

bill@entropy.ms.washington.edu (Bill Dunlap) (11/14/88)

I would like to write a resource converter to convert a String to
a ColormapSegment.   The String will be a list of color names.  It
seems reasonable to run through the list of color names and pass
each to CvtStringToPixel.  However, that is static to lib/Xt/Converters.c.
If I use XtConvert I must supply a widget but I have no widget to
supply when I register the converter (while in ClassInitialize()).
If I use XtDirectConvert I need access to CvtStringToPixel.
What is the best way to do this?

A side issue concerns allocating space for the ColormapSegment.  Its
length is unknown at compile time so I must XtMalloc() space for it.
Is there a conventional way to tell a widget that it must free space
allocated by a resource converter or for the widget to tell the
conversion mechanism that it is done with a resource?

Bill Dunlap
Dept. of Statistics, U. of Washington, Seattle
bill@elk.stat.washington.edu