Path: utzoo!mnetor!uunet!husc6!uwvax!oddjob!sphinx!cute From: cute@sphinx.uchicago.edu (John Robert Cavallino) Newsgroups: comp.sys.mac.programmer Subject: Re: WaitNextEvent question Message-ID: <3878@sphinx.uchicago.edu> Date: 4 Apr 88 23:34:19 GMT References: <1988Apr1.120105.112@mntgfx.mentor.com> <5587@well.UUCP> <8335@agate.BERKELEY.EDU> Reply-To: cute@sphinx.uchicago.edu.UUCP (John Robert Cavallino) Organization: The Institute for Putting Things On Top of Other Things Lines: 59 Keywords: WainNextEvent Multifinder screen-region In article <8335@agate.BERKELEY.EDU> laba-5as@widow.berkeley.edu.UUCP (Bob Heiney) writes: (explaination of MultiFinder mouseMoved events deleted) >When the user moves out of the region, my application >wakes up and calls a routine I have, FixCursor, that makes the cursor >whatever it should be (usually an arrow), and sets the mouse region to >be all of the screen EXCEPT for the viewRect. > >Those wishing to be Mac II compatible should use GetGrayRgn (or is it >GetGreyRgn?) to get the region for the screen, since there can be more >than one screen in the system. Following this suggestion introduces a "GOTCHA" in that the GrayRgn includes neither the menu bar nor the tiny areas beyond the rounded corners at the outside corners of the screen (or union of screens). Since the mouse cursor can enter these areas, a more correct way to construct a full-screen(s) region for cursor tracking is the following: a) Use SysEnvirons to check for Color Quickdraw b1) if it isn't present, just RectRgn(cursorRgn,screenBits.bounds) b2) if it is present, construct a region that is the union of the device rects of all ACTIVE gDevices. The fields are all documented in IM.V (which I don't have in front of me). To test if a gDevice is active you should use GetDeviceAttribute. > > tempRect:=myTextHandle^^.viewRect; > LocalToGlobal(tempRect.topLeft); > LocalToGlobal(tempRect.botRight); > RectRgn(mouseRgn,tempRect); { I believe this is the call, > but I'm typing from memory :-) } > DiffRgn(GetGrayRgn,mouseRgn,mouseRgn); > { now mouseRgn is the entire screen except for a hole where > viewRect is } > >Bob Heiney >laba-5as@widow.berkeley.edu l i n e s l i n e s l i n e s -- ...ihnp4!gargoyle!sphinx!cute --John Cavallino The train is the same, only the time is changed. Ecce homo, ergo elk.