Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!samsung!umich!umeecs!msi.umn.edu!cs.umn.edu!kksys!edgar!mmug!p510.f22.n282.z1.mmug.edgar.mn.org!Jim.Spencer From: Jim.Spencer@p510.f22.n282.z1.mmug.edgar.mn.org (Jim Spencer) Newsgroups: comp.sys.mac.programmer Subject: Mouse Location Message-ID: <5.27AA3EBE@mmug.edgar.mn.org> Date: 1 Feb 91 05:26:20 GMT Sender: ufgate@mmug.edgar.mn.org (newsout1.26) Organization: FidoNet node 1:282/22.510 - SmorgasBoard BBS, Twin Cities, MN USA Lines: 28 Robert Nelson Gasch writes in a message to All RNG> Does anybody out there know how to access the location of a mouseclick? The location of the mouse click is returned in the EventRecord with every event event. In its simplest form: myEvent: EventRecord; thelocation: Point; GetNextEvent(everyEvent, myEvent); case myEvent.what of ... mouseDown: ... thelocation := myEvent.where; {etc.} Note that the location of the mouse returned in where is global or screen coordinates. You may need to use GlobalToLocal(thelocation) to convert to your window's coordinates. You can also always call GetMouse(thelocation) and it will return the location of the mouse at the time it is called regardless of whether the mouse is down or not. -- Jim Spencer - via The Minnesota Macintosh Users Group UUCP-Fido Gateway UUCP: ...uunet!tcnet!kksys!edgar!mmug!22.510!Jim.Spencer INET: Jim.Spencer@p510.f22.n282.z1.mmug.edgar.mn.org