[Newbies] Morphic event-handling confusion

stephane ducasse stephane.ducasse at free.fr
Sun Mar 18 08:12:13 UTC 2007


here is an example of drag and drop and repel :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: DragAndDropRepel.3.cs
Type: application/octet-stream
Size: 1636 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20070318/6bd4de16/DragAndDropRepel.3.obj
-------------- next part --------------

Have fun
On 15 mars 07, at 07:31, Max OrHai wrote:

> I'm trying to use Morphic, in Squeak 3.9, to make a very simple  
> "physics
> model" I call a HockeyPuck. The idea is that it's a CircleMorph  
> subclass
> that one should be able to pick up with the Hand and "throw", and have
> it bounce off the World edge (and then, hopefully, other such Pucks).
> I've got the "step" animation thing figured out pretty well, and I  
> have
> some idea how to compute the motion and bounces and such, but I'm
> stumped as to how to properly handle the mouse events. On Eddie
> Cottongim's suggestion, at http://wiki.squeak.org/squeak/2477 , I  
> tried
> using  "self on: #startDrag send: #beginThrow to: self" (in my
> initialize method) but that seems a little weird, and doesn't seem to
> allow the default dragging behavior to go through. I also tried the
> approach of overriding handlesMouseDown and mouseDown, and sending
> "super mouseDown" in the latter, but that doesn't seem to work any
> better, although it makes a little more sense to me.
>
> There's a two-step sequence of messages I'd like my Puck to receive
> while still doing the normal getting-moved-by-the-Hand stuff. The  
> first
> is #beginThrow, to be sent either on a mouseDown or (preferably) on a
> startDrag event. The second is #endThrow, to be sent on the subsequent
> mouseUp. How can I make this happen?
>
> Thank you very much for your time.
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>



More information about the Beginners mailing list