[comp.windows.x] Help with colormaps on Xr4

tgades@skadi.physics.stolaf.edu (11/29/90)

I need help getting going on X windows.
I was completely new to this as of a month ago, and I
have gotten to the point that I can get a window up and going,
but I still cannot seem to understand how to change colormaps
from the default.  What I am trying to do is put together
a sort of frame into which I can insert graphics routines.

I have done this, but I only can access the 16 colors in the default
colormap.  If anyone has a program that I could easily rip apart
down to the bare minimum, or if anyone has doen the same thing 
(as I am sure nearly all of you have) could you please
send me Email the address of an anonymous ftp possibility,
or just mail me the program if you have one.  I would greatly
appreciate it.

Also can anyone tell me what they think is the best documentation
for Xlib programming?  I am currently using the set edited by
Adrian Nye  Published by O'Reilly & Acssociates Inc.

		thanks
						tgades@skadi.physics.stolaf.edu

mouse@LARRY.MCRCIM.MCGILL.EDU (12/01/90)

> [...] but I still cannot seem to understand how to change colormaps
> from the default.  [...] I only can access the 16 colors in the
> default colormap.

It may be that your server does not permit you to access anything else.
Run xdpyinfo and check the output for the availability of a PseudoColor
or DirectColor visual.  If all you have is a StaticColor visual, you
can't get arbitrary colors out of it.  (This is true of TrueColor and
StaticGray as well.  These three are the "static" visuals; you can't
change colormaps for these ones.  The other three, GrayScale and the
two I suggested you search for, are "modifiable": you can store into
them.  I'd be glad to mail you the details; drop me a line.)

> Also can anyone tell me what they think is the best documentation for
> Xlib programming?

Well, I just use the files in mit/doc/Xlib.... :-)

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu

mikey@sgi.com (Mike Yang) (12/02/90)

In article <1990Nov28.184225.29457@acc.stolaf.edu> tgades@skadi.physics.stolaf.edu () writes:
>I have done this, but I only can access the 16 colors in the default
>colormap.  If anyone has a program that I could easily rip apart
>down to the bare minimum, or if anyone has doen the same thing 
>(as I am sure nearly all of you have) could you please
>send me Email the address of an anonymous ftp possibility,

It would help if you told us what hardware configuration you have.  For
instance, if you're using an SGI machine with IRIX 3.3 by default,
the X server is started so that there are only 16 read/write colormap
cells for an 8-plane machine.  The rest are "preserved" for GL clients.

For a sample colormap program, try my cpicker application which
dynamically modifies the installed colormap.  It installs a new
colormap for an application window, and manipulates its entries.

Last time I checked, cpicker was available on expo.lcs.mit.edu in the
contrib directory as cpicker.tar.Z.

-----------------------------------------------------------------------
                 Mike Yang        Silicon Graphics, Inc.
               mikey@sgi.com           415/335-1786