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: DragGrayRgn() procedure problem with color. Date: Wed, 1 May 91 14:13:47 EST Organization: ICE Engineering, Inc. Message-ID: <1CE00001.ei5m1b@tbomb.ice.com> Reply-To: time@ice.com X-Mailer: uAccess - Mac Release: 1.1.b3 Lines: 34 I have a program which allows you to drag objects from one window to another. The program uses the DragGrayRgn() procedure to do the dragging of an outline of the objects, while using the "Drag Procedure" of the DragGrayRgn() call to implement the code that tracks the objects and highlights active targets they pass over. Of course, during this dragging of the objects, the target objects are highlighted and unhighlighted as the gray outline passes over them using some type of "inversion". Now, with color I am using the global gHiliteMode bit to indicate that the "inversion" should use the current "hilite color". This is fine, as the InvertRect() and like calls use the nice color I selected in the Color Control Panel item. HOWEVER, when I am dragging the gray region around, and I pass over one object that is highlighted to the next one, so that the highlighted targets *change* *UNDERNEATH* the dragged gray rgn, then I get all these little lines left all over the place. It appears that the inversion has changed the context underneath the region and when it is XOR-ed during the dragging it doesn't do what it is supposed to. I have tried to invert the dragged gray rgn at the begginning and end of my drag procedure, but that seems to leave more garbge all over the place. I also notice that the Finder handles this same case perfectly. Anyone know the secret? ------------------------------------------------------------- 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