Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!ox.com!heifetz!tbomb!time From: time@ice.com (Tim Endres) Newsgroups: comp.sys.mac.programmer Subject: Re: DragGrayRgn() procedure problem with color. Date: Sun, 5 May 91 19:35:48 EST Organization: ICE Engineering, Inc. Message-ID: <1CE00001.eudyum@tbomb.ice.com> Reply-To: time@ice.com X-Mailer: uAccess - Mac Release: 1.1.b3 Lines: 37 In article <1991May4.232051.13698@agate.berkeley.edu>, deadman@garnet.berkeley.edu (Ben Haller) writes: > Well, since you mention "the Finder does this perfectly" I have to wonder > exactly what you're talking about. It looks to me like, as far as > DragGrayRgn is concerned, the Finder completely ignores the current > highlight color. And well it should, it would have the same problem you're > having if it tried. This is not true on my machine. The icon highlights in black, but the text is in the current hilite color. And it works. I have now discovered that the Finder does not call DragGrayRgn0() but implements one for itself. > The problem is that the DragGrayRgn routine depends on xor working like > xor, not like some bizarre half-breed created by setting the hilite bit and > thereby driving QuickDraw out of its poor little mind. The operation must > be reversible, i.e. a xor b xor b must equal a. When you set the hilite > bit you mess this up, since you've told QuickDraw to perform a > non-reversible operation. So you get garbage on your screen. No surprise. > This isn't what the hilite color is supposed to be used for anyway. So > don't...you know, just *don't*. Turns out that the problem is simply the changing of the screen bits between invocations of DragGrayRgn0()'s FrameRgn() calls. I then had the drag region framed at the beginning and end of my drag proc and all was fine. Except on subtle point. When the cursor got close to the edge of the screen, the region would quit being framed (disappear), but my routine couldn't tell. So I wrote a DragGrayRgn() that doesn't hide the region and all works fine now. tim. ------------------------------------------------------------- Tim Endres | time@ice.com ICE Engineering | uupsi!ice.com!time 8840 Main Street | Voice FAX Whitmore Lake MI. 48189 | (313) 449 8288 (313) 449 9208