home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / lisp / mcl / 1319 < prev    next >
Encoding:
Text File  |  1992-08-26  |  2.7 KB  |  68 lines

  1. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!wupost!sdd.hp.com!uakari.primate.wisc.edu!ames!data.nas.nasa.gov!taligent!apple!cambridge.apple.com!bill@cambridge.apple.com
  2. From: bill@cambridge.apple.com (Bill St. Clair)
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: Re: main-screen-color-p
  5. Message-ID: <9208261602.AA14943@cambridge.apple.com>
  6. Date: 26 Aug 92 17:06:34 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 54
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10. Full-Name: Bill St. Clair
  11. Original-To: wilcox@cmns.think.com, Henry Lieberman <lieber@MEDIA-LAB.MEDIA.MIT.EDU>
  12. Original-Cc: info-mcl
  13.  
  14. >Date: Wed, 26 Aug 92 11:04:51 EDT
  15. >From: wilcox@cmns.think.com
  16. >To: info-mcl@cambridge.apple.com
  17. >Subject: main-screen-color-p
  18. >
  19. >Here's a quick way to tell if the main screen can display in color:
  20. >
  21. >(defun main-screen-color-p ()
  22. >  "Is the main screen capable of displaying color?"
  23. >  ;; *color-available* just tells you if color quickdraw is in ROM
  24. >  ;; it doesn't tell you if the screen can display in color
  25. >  ;; #_getmaindevice trap gives handle to screen containing menubar
  26. >  (let ((screen (#_getmaindevice))
  27. >        (gddevtype 0))
  28. >    (#_testdeviceattribute screen gddevtype)
  29. >    ))
  30.  
  31. If you run this code on a machine where *color-available* is NIL,
  32. it will crash. Better would be:
  33.  
  34. (defun main-screen-color-p ()
  35.   "Is the main screen capable of displaying color?"
  36.   ;; *color-available* just tells you if color quickdraw is in ROM
  37.   ;; it doesn't tell you if the screen can display in color
  38.   ;; #_getmaindevice trap gives handle to screen containing menubar
  39.   (and *color-available*
  40.        (let ((screen (#_getmaindevice))
  41.              (gddevtype 0))
  42.          (#_testdeviceattribute screen gddevtype)
  43.          )))
  44.  
  45. >Date: Wed, 26 Aug 92 11:35:14 -0400
  46. >From: Henry Lieberman <lieber@MEDIA-LAB.MEDIA.MIT.EDU>
  47. >To: info-mcl@MEDIA-LAB.MEDIA.MIT.EDU
  48. >Subject: main-screen-color-p
  49. >
  50. >
  51. >Main-Screen-Color-P still doesn't do it, I'm afraid. 
  52. >On my machine, a color screen, it returns T, but when I set the
  53. >Monitors control panel to black-and-white, it still returns T.
  54. >
  55. >I think what most programs will want to know is whether color pixels
  56. >are actually reaching the user's retina, not if the screen has the
  57. >"capability" in some sense to do color display.
  58.  
  59. It does the right thing in my hardware setup. Changing between 256 colors
  60. and 256 grays toggles the value returned. I've got an 8*24 GC board
  61. going to my color monitor. Maybe your monitor interface hardware is
  62. doing the wrong thing.
  63.  
  64. For those of you with CD-ROM drives, there are a number of unexported
  65. functions having to do with graphics devices at the end of the file:
  66.  
  67.    "MCL 2.0 CD:Additional MCL Source Code:Lib:color.lisp"
  68.