home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18520 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.4 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!spool.mu.edu!nigel.msen.com!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!natinst.com!natinst.com!not-for-mail
  2. From: stepan@natinst.com (Stepan Riha)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Hilite a Rect
  5. Date: 17 Nov 1992 08:30:44 -0600
  6. Organization: National Instruments, Austin, TX
  7. Lines: 24
  8. Message-ID: <1eavmkINNojo@falcon.natinst.com>
  9. References: <1e9v71INNgqn@agate.berkeley.edu>
  10. NNTP-Posting-Host: falcon.natinst.com
  11. Keywords: color, hilite, novice
  12.  
  13. In article <1e9v71INNgqn@agate.berkeley.edu> bfoley@obelisk.berkeley.edu (Brian Foley) writes:
  14. >How do you hilite a rect using the current hilite color?
  15. >I am using InvertRect() now, but it would be "better" to do it
  16. >in color.  Inside Mac is rather vague on the subject I tried using 
  17. >
  18. >BitClr ((Ptr) HiliteMode, pHiliteBit);  /* IM V-61 */
  19. >
  20. >but that gave me a bus error.
  21.  
  22. I never use the BitClr function (for byte to long sized variables) because
  23. you get the extra trap dispatch overhead.  The way I code my highlights is:
  24.  
  25.     *(char*)HiliteMode &= ~(0x01<<hiliteBit);
  26.  
  27. Note that <Quickdraw.h> defines pHiliteBit = 7 and hiliteBit = 0, that's
  28. because BitClr(ptr, bitNr) counts the high order bit of *ptr as bit 0.
  29. IM I p.470-471.
  30.  
  31. However, I don't know why your code using BitClr should cause a buss error.
  32.  
  33.     - Stepan
  34. -- 
  35.    Stepan Riha -- stepan@natinst.com
  36.  
  37.