home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 21280 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  1.5 KB

  1. Path: sparky!uunet!gatech!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!kth.se!hemul.nada.kth.se!d88-jwa
  2. From: d88-jwa@hemul.nada.kth.se (Jon Wtte)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Detecting mouse position in a window ?
  5. Keywords: faq mouse in window regions etc help
  6. Message-ID: <1993Jan12.132059.9247@kth.se>
  7. Date: 12 Jan 93 13:20:59 GMT
  8. References: <rudolph.726810080@unixg.ubc.ca> <1993Jan12.050224.14617@magnus.acs.ohio-state.edu>
  9. Sender: usenet@kth.se (Usenet)
  10. Organization: Royal Institute of Technology, Stockholm, Sweden
  11. Lines: 22
  12. Nntp-Posting-Host: hemul.nada.kth.se
  13.  
  14. In <1993Jan12.050224.14617@magnus.acs.ohio-state.edu> jbush@magnus.acs.ohio-state.edu (J Eric Bush) writes:
  15.  
  16. >Just use the GetMouse(p:point) procedure.  If at first it gives you a global 
  17. >point, then all you have to do it say point:=GlobalToLocal(p).
  18.  
  19. This is wrong; instead, create a region (in global coordinates)
  20. that covers ALL the areas where the cursor should stay the
  21. same as it is now; pass that region to WaitNextEvent. Also set
  22. the cursor appropriately before each call to WaitNextEvent.
  23.  
  24. Now, everytime the cursor strays outside the appropriate area
  25. for its shape, you will get a mouseMoved event (osEvt, app4Evt)
  26. and before calling WaitNextEvent the next time, you will set the
  27. cursor to its new shape and calculate a new region.
  28.  
  29. Cheers,
  30.  
  31.                             / h+
  32. -- 
  33.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  34.    This signature is kept shorter than 4 lines in the interests of UseNet
  35.    S/N ratio.
  36.