home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.hypercard
- Path: sparky!uunet!munnari.oz.au!metro!usage!spectrum!cnquinn
- From: cnquinn@spectrum.cs.unsw.oz.au (Clark Quinn)
- Subject: Trapping messages between windows?
- Message-ID: <1992Aug17.070911.10151@usage.csd.unsw.OZ.AU>
- Sender: news@usage.csd.unsw.OZ.AU
- Nntp-Posting-Host: sea.spectrum.cs.unsw.oz.au
- Reply-To: cnquinn@spectrum.cs.unsw.oz.au (Clark Quinn)
- Organization: none
- Date: Mon, 17 Aug 1992 07:09:11 GMT
- Lines: 46
-
- While talking to two of my students who are working on an
- adventure game implementation, we came across an interesting
- bit of HyperCard behavior we were wondering if anyone could
- illuminate:
-
- The goal is to trap icon drags between windows. To do this
- we were using the mouseStill Down and seeing what happened
- when we dropped off a card. We used the following scripts:
-
- on mouseStillDown
- set loc of button "New Button" to the mouseLoc
- end mouseStillDown
-
- on mouseUp
- beep
- end mouseUp
-
- When we dragged the mouse with the button off the screen and dropped,
- no beep. Then, because we were trying to trap the drop and return the
- button to a visible position, we tried this substitute for the
- mouseStillDown routine (hoping to add the trap after the repeat loop)
-
- on mouseDown
- repeat while the mouse = "down"
- set loc of button "New Button" to the mouseLoc
- end repeat
- end mouseDown
-
- Surprise, there *was* a beep from the mouseUp handler on this one!
- NB: the mouseStillDown code was commented out for this trial. I tried
- both again (with the other commented out) just to make sure we weren't
- going crazy.
-
- Now, I can't explain this to myself, let alone them, so I promised to
- send out a request for explanation. Anyone got an idea? -- Clark
-
- ---------------------------------------------------------------------------
-
- _--_|\ Dr. Clark N. Quinn
- / \ School of Computer Science and Engineering +61-2-697-4034
- \_.--._* The University of New South Wales Fax +61-2-313-7987
- v PO Box 1 cnquinn@cs.unsw.oz.au
- Kensington, NSW
- AUSTRALIA 2033
-
- "A California Yankee in the Land of Oz"
-