Re: XForms: separate colormap for canvas - problems

Steve Lamont (spl@szechuan.ucsd.edu)
Sat, 22 Nov 97 15:54:06 PST

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> I have written an XForms-based image display program. The image is
> displayed in gray scale in a canvas. Normally it uses shared color
> cells (just to avoid color flashing). But if the default colormap
> has too few cells available, I'd like to create a new colormap for the
> canvas (or for the whole form).
>
> ...
>
> Unfortunately, this does not work as I expected. It is OK if it
> allocates all colors in the first loop. But when this fails,
> program creates new colormap, successfully allocates all colors (!)
> but on the screen I get majority of colors in the image canvas
> being not gray but brown/green/blue. And there is no color flashing when
> I move mouse pointer in/out the canvas (what I expected should happen if
> the canvas has different colormap - it is even mentioned in the XForms
> manual in fl_create_colormap description).

What you're doing is right and, as far as I can tell, what XForms is
doing is right but obviously something's wrong somewhere.

The problem is in the window manager. It is not installing the
Colormap when the window gets Cursor focus and I'm not sure why, since
the XA_WM_COLORMAP_WINDOWS property is being correctly set by XForms
when the Canvas window is being created. There is obviously some sort
of event propagation that is going awry. Perhaps playing around with
the properties and masks of the parent (form) window might help.

I struggled with this for a long time before finally giving up and
using the default Colormap and octree quantization to solve the
problem.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/