Re: XForms colormap

Trent Piepho (
Mon, 20 Jan 1997 15:01:27 -0800 (PST)

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

On Mon, 20 Jan 1997, Andrew Baucom wrote:
> Hi,
> Does anyone have any example code I could view to see how to create a
> custom colormap?

This is what I did for a similar project.

/* select an 8-bit pseudocolor visual */
XVisualInfo xvi;

/* create a custom colormap */
Colormap colormap;

XColor colortable[256];
/* initialize colortable to the colors you want */

/* set the canvas's colormap */

All this must be done _before_ you call fl_show_form. There is still more
though. If your not using a SGI system, you need to have the active
colormap switch to canvas's colormap when the mouse enters the canvas.

|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 |
To unsubscribe, send the message "unsubscribe" to or see