I'm trying to give a canvas object a different colormap than the rest
of the window, but it just doesn't seem to be working.
First I select a PseudoColor visual:
if(!XMatchVisualInfo(dpy,0,8,PseudoColor,&xvi)) {
fprintf(stderr,"Couldn't get 8-bit PseudoColor visual\n");
exit(1);
};
fl_set_canvas_visual(Canvas,xvi.visual);
Then I show the form, so I can get the window ID.
Then I create a colormap:
CanvasColormap=XCreateColormap(dpy,CanvasWindow,xvi.visual,AllocAll);
XColor colortable[50];
/* stuff to set colortable */
XStoreColors(dpy,CanvasColormap,colortable,50);
And finally set the canvas's colormap;
fl_set_canvas_colormap(Canvas,CanvasColormap);
For good measure:
XSetWindowColormap(dpy,CanvasWindow,CanvasColormap);
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?
I looked at the demos, and the gl demo seems to do what I want. The glcanvas
seems to have a different colormap, at least I get screen flicker when moving
into and outof the window. But everything seems to be taken care of by gl, so
that demo isn't helping.
|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 (xyzzy@u.washington.edu) -- Metallica |