Re: XForms: colormaps and canvases

Steve Lamont (
Wed, 22 Oct 97 12:02:53 PDT

To subscribers of the xforms list from (Steve Lamont) :

> It looks to me as if XForms is calling XFreeColormap() for colormaps
> assigned to canvases with fl_set_canvas_colormap(). Is that what's going
> on? I would think that if I hand a canvas a colormap, then it should be my
> responsibility to free it, and XForms should leave it alone.

Are you using the gl.c supplied with XForms? There are some
strangenesses in it that, as I recall.

> How do I copy one colormap to the other? My manuals have
> XCopyColormapAndFree(), but no XCopyColormap().

You'll have to use Brute Force[tm]. I'm not in my lab so I don't have
access to the manuals right now but you should be able to use the
color handling primitives.

Regarding using the default Colormap, it might not be as bad as you
think. XForms doesn't reserve that many colors and most of them are
pretty common, so, if you're aggressive about optimization, you can
use almost the entire map.

When I get back on Monday, I can share some code which might be useful
in doing colormap management.

To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: