[Newbies] Morphic event-handling confusion
max at nbtsc.org
max at nbtsc.org
Sun Mar 18 06:27:00 UTC 2007
Thanks, I already got it working, which was in fact a very satisfying experience. My previous failure was using a "handlesMousedown" method, rather than "handlesMouseDown:evt" method. An important distinction.
Sent via BlackBerry from T-Mobile
-----Original Message-----
From: Michael van der Gulik <mikevdg at gulik.co.nz>
Date: Sat, 17 Mar 2007 17:45:07
To:"A friendly place to get answers to even the most basic questions aboutSqueak." <beginners at lists.squeakfoundation.org>
Subject: Re: [Newbies] Morphic event-handling confusion
Max OrHai wrote:
>
>
>>handlesMouseStillDown: evt
>> ^ true
>>
>>mouseStillDown: evt
>> self position: evt hand position.
>>
>>
>
>These apparently don't do anything. But, that's OK, because I can, as
>Bert suggested, just send "evt hand #grabMorph: self".
>
>Except, oops, that's NOT OK, because now mouseUp: apparently never gets
>sent to my Morph.
>
>So, I still need help. Thank you both very much.
>
>
They "worked for me" - I was dragging a Morph around, and had readouts
for the start and end positions of the dragging. Try making a completely
fresh subclass of Morph with only the methods I suggested. I used Squeak
3.9.
If I was going to implement momentum, I'd take the current position on
mouseUp: and the position received by the very latest mouseStillDown:,
and work out which vector the puck should travel in from that. I suppose
you'd also need the times of those two events as well to calculate the
velocity vector.
Michael.
_______________________________________________
Beginners mailing list
Beginners at lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners
More information about the Beginners
mailing list