home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / alt / toolkits / xview / 1164 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  2.7 KB

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