Re: [gtk-list] gdk_rgb_set_install
- From: Valdis Kletnieks vt edu
- To: gtk-list redhat com
- Subject: Re: [gtk-list] gdk_rgb_set_install
- Date: Thu, 04 Nov 1999 22:23:22 -0500
On Wed, 03 Nov 1999 20:40:16 PST, Arthur Jerijian <email@example.com> said:
> I am trying to disable installation of a private colormap using GdkRGB.
> I have read the source code for GdkRGB and determined that gdk_rgb_set_install
> is to be called *BEFORE* gdk_rgb_init. However, if I call gdk_rgb_set_install
> with a value of FALSE, I still get a privately installed colormap when I use a
> grayscale visual.
> Am I doing something incorrect?
More likely, you're doing it correctly but not understanding the implications.
If you're using a grayscale visual, this almost requires a private colormap
if your default visual/colormap are PseudoColor or TrueColor. The problem
is that if in the default colormap, pixel 3 is "red", there is no good way to use
that pixel in your greyscale visual with the default colormap (which says
that pixel 3 is red).
The only way to get away with this is to take *only* the previously unallocated
color cells from your default colormap, and then XAllocColor() into them with
various values of grey, and then only use those values in your program so as
to avoid colormap flashing. But at that point, you almost might as well just
use a PseudoColor visual.
I have *not* checked the code, but I wouldn't be surprised if Gdk forces
the use of a private colormap if the visual is (a) not the same class as
the default visual and (b) requires a colormap. At least at the X level,
you can cheat a bit if the default is (say) 8-bit PseudoColor but your visual
is a 34-bit TrueColor. But if you're mixing PseudoColor and GreyScale, you're
looking for trouble. ;)
Operating Systems Analyst
] [Thread Prev