home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky alt.toolkits.xview:1164 comp.windows.open-look:4940
- Newsgroups: alt.toolkits.xview,comp.windows.open-look
- Path: sparky!uunet!island!coney!hue
- From: hue@island.COM (Pond Scum)
- Subject: Re: minimizing flashing by preserving colors in colormap
- Message-ID: <hue.725788469@coney>
- Sender: usenet@island.COM (The Usenet mail target)
- Organization: Island Graphics Corp.
- References: <1992Dec28.144043.14792@mr.med.ge.com>
- Date: Thu, 31 Dec 1992 07:54:29 GMT
- Lines: 38
-
- carl@crazyman.med.ge.com (Carl Crawford) writes:
- >my xview application sometimes allocates more slots than are available
- >in the system colormap (cm). when this happens, xview (xlib ?) gives
- >me a colormap segment (cms) that begins at location zero in the system
- >cm and maps it in when necessary. the colors that i use for the first
- >few locations are used by xview and openwindows for background,
- >foreground, and highlighting by other applications. to minimize
- >flashing i am trying allocate a slightly larger cm and preserve these
- >special locations. using some kludgey code i am able to figure out
- >what to put in the locations. does anyone know of a better way to
- >prevent the flashing? if not, is there a robust method to figure out
- >the number of locations to preserve and their contents?
-
- I don't know a really good way. On my machine, with the order that I
- start things and the .Xdefaults that I use, the first two colors in
- the colormap are white and black. The next four are various shades
- of blue used by olwm. The next four are various shades of grey used
- by my XView applications. If I copy those ten colors into the bottom
- of a cms, and "lie" about it not being a control cms (so xview continues
- to use the the same pixel values to draw), I don't have too much of a
- flashing problem. If I started my xterms before I started my XView
- applications, the greys would probably start later in the colormap, and
- I would need to copy more than the first ten colors into my colormap to
- avoid most of the flashing. I actually don't bother doing this most of
- the time, I just make a control CMS to make sure the application is
- consistent with itself and live with whatever flashing occurs. I know
- someone who always copies the first sixteen entries out of the default
- colormap, feeling that the first sixteen colors are probably the ones you
- always want to see.
-
- Colormap segments are easy to use but there are some things you can't do
- with them. I have one application which needs 128 colors in an rgb-232
- colormap, plus about a dozen more who's value I don't know when I create
- the cms, so I make a 128 color cms and attach it to the window, then get
- the X colormap for the window and XAllocColor a dozen more as needed.
- It seems to work ok.
-
- -Jonathan hue@island.COM
-