larrym@randvax.UUCP (Larry McDonough) (04/12/91)
Help! Xlib color gurus out there,
I'm having some curious problems with color on a Mac. I'm writing
all my code in C on a Sun SparcStation running SUNOS 4.1.1 and occasionally
I want to display my program on a MacII F/X running the MacX1.1 X11 Server.
For a small set of color cells, those that I could alloc from the
DefaultColormap, all works fine. But, when there aren't enough color
cells in the DefaultColormap to meet my needs (sometimes I need 256),
I create my own colormap (XCreateColormap), Alloc the cells I need
(XAllocColorCells), Store the colors in the colormap (XStoreColors),
and finally change the CWColormap attribute for the window
(XChangeWindowAttributes or XSetWindowColormap). This works fine on the
suns. The only thing I found out is that I need to install/uninstall this
non-default colormap myself (at least this is true for my window manager
olwm) when entering and exiting the window.
My problem is, that when I run this on a sun and display on a
MacII/FX there is never enough room on the DefaultColormap for even 128
color cells, so I'm forced to create my own. This is no big deal, but
that all calls to create and install this new colormap (as described above)
seem to get ignored. Nothing happens. Any ideas? I do know that about
4 cells are getting allocated. These appear to be the ones specified by
the user's resources (fg/bg and window border colors I think).
Any clue would be appreciated.
Thanks in advance,
--Larry McDonough office: (213) 393-0411 x6763
The Rand Corporation internet: larrym@rand.org
Santa Monica, CA