home *** CD-ROM | disk | FTP | other *** search
- 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
- From: stepan@natinst.com (Stepan Riha)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Hilite a Rect
- Date: 17 Nov 1992 08:30:44 -0600
- Organization: National Instruments, Austin, TX
- Lines: 24
- Message-ID: <1eavmkINNojo@falcon.natinst.com>
- References: <1e9v71INNgqn@agate.berkeley.edu>
- NNTP-Posting-Host: falcon.natinst.com
- Keywords: color, hilite, novice
-
- In article <1e9v71INNgqn@agate.berkeley.edu> bfoley@obelisk.berkeley.edu (Brian Foley) writes:
- >How do you hilite a rect using the current hilite color?
- >I am using InvertRect() now, but it would be "better" to do it
- >in color. Inside Mac is rather vague on the subject I tried using
- >
- >BitClr ((Ptr) HiliteMode, pHiliteBit); /* IM V-61 */
- >
- >but that gave me a bus error.
-
- I never use the BitClr function (for byte to long sized variables) because
- you get the extra trap dispatch overhead. The way I code my highlights is:
-
- *(char*)HiliteMode &= ~(0x01<<hiliteBit);
-
- Note that <Quickdraw.h> defines pHiliteBit = 7 and hiliteBit = 0, that's
- because BitClr(ptr, bitNr) counts the high order bit of *ptr as bit 0.
- IM I p.470-471.
-
- However, I don't know why your code using BitClr should cause a buss error.
-
- - Stepan
- --
- Stepan Riha -- stepan@natinst.com
-
-