logo       

Re: Morphic event-handling confusion: msg#00109

lang.smalltalk.squeak.beginners

Subject: Re: Morphic event-handling confusion

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@xxxxxxxxxxx>
Date: Sat, 17 Mar 2007 17:45:07
To:"A friendly place to get answers to even the most basic questions
aboutSqueak." <beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/mailman/listinfo/beginners
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise