On Wed, 15 Jan 1997, Steve Lamont wrote:
> To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :
> > Won't this destroy the colormap used by the rest of the window? Or
> > does XForms allocate another colormap for the canvas?
>
> Yes, the latter is correct -- XForms gives you your own colormap in a
> Canvas.
Accorind to xwininfo, both the main form and the canvas are using the
same colormap. When I don't install my own that is.
> > Well, because the colors are wrong. If I grab a section of the canvas with
> > xmag, the xmag window will have the proper colormap. [...]
> >
> > 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.
>
> Remember that a Colormap is only installed by the window manager
> and/or server when you have focus in the Window to which it belongs.
> This may seem elementary but have you tried moving the pointer into
> the Canvas window to see what happens? (I'd be surprised if you
> didn't but it's worth asking.)
Yes, I think this is where my problem lies. xwininfo says my canvas is using
the colormap I created, but it isn't installed. Putting the mouse inside the
canvas doesn't install it, but it should. This is on fvwm, twm and 4Dwm. I
know that the gl demo does cause a colormap switch on the canvas window, so it
is possible, xforms just doesn't do it for me.
> It might be interesting to query the Colormap attribute of the Window
> later on in the program and compare it with the Colormap you think
> you've assigned, just to see if they're the same.
Yes, they are. It's using the new one, non-installed.
> Another thing to watch out for: if you hide the form with
> fl_hide_form(), the Canvas is destroyed by XForms and recreated when
> you show the form again. This means that the Window is destroyed and
> recreated and a *new* colormap is created. This will be the source of
Arghhh. I didn't know that. I'm not deleting this form, but I think
I'll check some of my other programs.
> BTW, it's a Hard and Fast Rule: *do not ever* install your own
> colormap with XInstallColormap(). The ICCCM says this is a big no-no!
Opps. I hope they don't catch me. I'm also running this program on an SGI
with nifty multiple colormaps ability. I can make it work by using
XInstallColormap, otherwise the new colormap never gets installed. The SGI
can have multiple colormaps intalled at the same time, so there is no flash.
|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 |