home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / windows / x / 16238 < prev    next >
Encoding:
Text File  |  1992-09-08  |  1.8 KB  |  40 lines

  1. Newsgroups: comp.windows.x
  2. Path: sparky!uunet!snorkelwacker.mit.edu!thunder.mcrcim.mcgill.edu!mouse
  3. From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
  4. Subject: Re: Getting foreground/background colors of a window.
  5. Message-ID: <1992Sep6.065937.16145@thunder.mcrcim.mcgill.edu>
  6. Organization: McGill Research Centre for Intelligent Machines
  7. References: <1992Sep2.132746.26532@enea.se>
  8. Date: Sun, 6 Sep 92 06:59:37 GMT
  9. Lines: 30
  10.  
  11. In article <1992Sep2.132746.26532@enea.se>, mla@enea.se (Mats L|fstr|m) writes:
  12.  
  13. > For reasons of my own, I want to know the foreground and background
  14. > colors used in a window.  But the window isn't created by my
  15. > application, but rather by any other application.  Is there any way
  16. > of getting this information?
  17.  
  18. Only by inference, by reading back what's in the window and trying to
  19. figure it out.  One problem is that foreground and background may not
  20. be well-defined; consider a GIF file displayer, for example.  Another
  21. problem is telling the difference; consider an xterm with large
  22. quantities of text displayed reversed - how are you to know which part
  23. of the window is "reverse" and which is "normal"?
  24.  
  25. It's true that every window has a background of some sort.  But this
  26. can be a pixel value, a pixmap, ParentRelative, or None.  In only one
  27. of these cases is it even conceptually well-defined to ask what the
  28. window's background color is, and in any case, you can't even find out
  29. which alternative is in effect for a given window, never mind telling
  30. what the pixel value is or pixmap contents are.  (Not
  31. non-destructively, that is.  By playing games with obscuring portions
  32. of the window in various ways and other things, you may be able to
  33. deduce some things about the window's background.  All such attempts
  34. suffer from races with the window's application redrawing the window's
  35. contents.)
  36.  
  37.                     der Mouse
  38.  
  39.                 mouse@larry.mcrcim.mcgill.edu
  40.