home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / mac / hypercar / 3118 < prev    next >
Encoding:
Text File  |  1992-08-16  |  2.1 KB  |  59 lines

  1. Newsgroups: comp.sys.mac.hypercard
  2. Path: sparky!uunet!munnari.oz.au!metro!usage!spectrum!cnquinn
  3. From: cnquinn@spectrum.cs.unsw.oz.au (Clark Quinn)
  4. Subject: Trapping messages between windows?
  5. Message-ID: <1992Aug17.070911.10151@usage.csd.unsw.OZ.AU>
  6. Sender: news@usage.csd.unsw.OZ.AU
  7. Nntp-Posting-Host: sea.spectrum.cs.unsw.oz.au
  8. Reply-To: cnquinn@spectrum.cs.unsw.oz.au (Clark Quinn)
  9. Organization: none
  10. Date: Mon, 17 Aug 1992 07:09:11 GMT
  11. Lines: 46
  12.  
  13. While talking to two of my students who are working on an
  14. adventure game implementation, we came across an interesting
  15. bit of HyperCard behavior we were wondering if anyone could
  16. illuminate:
  17.  
  18. The goal is to trap icon drags between windows.  To do this
  19. we were using the mouseStill Down and seeing what happened 
  20. when we dropped off a card.  We used the following scripts:
  21.  
  22.   on mouseStillDown
  23.     set loc of button "New Button" to the mouseLoc
  24.   end mouseStillDown
  25.  
  26.   on mouseUp
  27.     beep
  28.   end mouseUp
  29.  
  30. When we dragged the mouse with the button off the screen and dropped,
  31. no beep.  Then, because we were trying to trap the drop and return the
  32. button to a visible position, we tried this substitute for the
  33. mouseStillDown routine (hoping to add the trap after the repeat loop)
  34.  
  35.   on mouseDown
  36.     repeat while the mouse = "down"
  37.       set loc of button "New Button" to the mouseLoc
  38.     end repeat
  39.   end mouseDown
  40.  
  41. Surprise, there *was* a beep from the mouseUp handler on this one!
  42. NB: the mouseStillDown code was commented out for this trial.  I tried
  43. both again (with the other commented out) just to make sure we weren't
  44. going crazy.
  45.  
  46. Now, I can't explain this to myself, let alone them, so I promised to
  47. send out a request for explanation.  Anyone got an idea? -- Clark
  48.  
  49. ---------------------------------------------------------------------------
  50.  
  51.  _--_|\    Dr. Clark N. Quinn
  52. /      \   School of Computer Science and Engineering        +61-2-697-4034
  53. \_.--._*   The University of New South Wales            Fax +61-2-313-7987
  54.       v    PO Box 1                                  cnquinn@cs.unsw.oz.au
  55.            Kensington, NSW
  56.            AUSTRALIA 2033                                      
  57.  
  58.            "A California Yankee in the Land of Oz"
  59.