Changes to mouseUp handling?

Raab, Andreas Andreas.Raab at disney.com
Mon Nov 6 21:37:50 UTC 2000


Ned,

Due to some legacy code I had to make sure only those morphs receive mouse
up that are the current mouse focus. Since neither the dropped morph nor its
recipient are the mouse focus, none of them will get the mouse up event [I
actually wanted to dispatch the event that lead to the drop itself but it
turned out that this raises even more legacy issues which I couldn't fix
rapidly enough to make it work]. So the short answer is to make the dropped
morph sensible to mouse up when it dropped:

MyMorph>>justDroppedInto: someMorph event: anEvent
	super justDroppedInto: someMorph event: anEvent.
	anEvent hand newMouseFocus: self.

BTW, the mouse over handler is completely unrelated to this entire issue. It
only figures out what morphs are currently "under" the hand to generate
appropriate mouse enter/leave events.

  - Andreas

> -----Original Message-----
> From: Ned Konz [mailto:ned at bike-nomad.com]
> Sent: Monday, November 06, 2000 1:20 PM
> To: Squeak List
> Cc: recipient list not shown
> Subject: Changes to mouseUp handling?
> 
> 
> Well, I just updated my 2.9a image to the latest. And, as expected,
> it broke my Attachment stuff.
> 
> So I went to track down why, and found that my AttachmentPointMorphs
> are no longer getting mouseUp events sent to them when they're dropped
> on another Morph.
> 
> On mouseDown, I have the AP grabbed by the Hand, and then 
> respond to the
> mouseUp later when it's dropped. I can't use the usual 
> drag'n'drop mechanism,
> since I have to work with ANY morph that an AP is dropped 
> upon. And most
> Morphs don't want other morphs dropped on them.
> 
> But now I don't seem to have my mouseUp: (or even 
> handleMouseUp: ) called.
> 
> It looks like, instead of passing the DropEvent to the Morph, 
> it's being
> passed to the Hand's owner (the World).
> 
> And the mouseOverHandler is not calling mouseUp:.
> 
> Previously, if you had returned true to handlesMouseDown:, you would
> receive (mouseDown:, mouseMove:, mouseUp:) events. The comment in
> Morph>>handlesMouseDown: still suggests that is the case.
> 
> However, it seems that if a Morph is grabbed by the Hand, it loses
> its chance to be notified upon mouseUp.
> 
> Any suggestions?
> 
> -- 
> Ned Konz
> currently: Stanwood, WA
> email:     ned at bike-nomad.com
> homepage:  http://bike-nomad.com
> 





More information about the Squeak-dev mailing list