Re: canvas colormaps

Trent Piepho (
Wed, 15 Jan 1997 08:02:16 -0800 (PST)

To subscribers of the xforms list from Trent Piepho <> :

On Wed, 15 Jan 1997, Steve Lamont wrote:
> To subscribers of the xforms list from (Steve Lamont) :
> > The problem is that the canvas's colormap is still the normal xforms default
> > colormap. Am I forgetting something, or doing something in the wrong order?
> Looks right to me. The only other thing I do is to destroy the
> Colormap that XForms has created with XFreeColormap() to keep the
> Server from getting polluted.

Won't this destroy the colormap used by the rest of the window? Or does XForms
allocate another colormap for the canvas?

> How do you know you're getting the "wrong" Colormap? Are you querying
> the XID of the Colormap in your drawing handler? What does xwininfo
> say?

Well, because the colors are wrong. If I grab a section of the canvas with
xmag, the xmag window will have the proper colormap. xwininfo says this for
the main window:
xwininfo: Window id: 0x1000016 "Mandelbrot"
Colormap: 0x26 (installed)

and this for the canvas's window, when the mouse is in the canvas:
xwininfo: Window id: 0x1000038 "flcanvas0"
Colormap: 0x100003b (not installed)

It seems I'm setting the colormap properly, the window manager just isn't
installing it for me. I've tried both fvwm and twm; I don't think it's a
window manager bug.

> Finally, for such a relatively small number of colors, why not use the
> Colormap XForms hands you and just add what you need rather than
> creating your own Colormap and having to deal with all the color
> flashing?

I'm going to use more.

|Gazing up to the breeze of the heavens \ on a quest, meaning, reason |
|came to be, how it begun \ all alone in the family of the sun |
|curiosity teasing everyone \ on our home, third stone from the sun. |
|Trent Piepho ( -- Metallica |