[NEWBIE] mouseUp help

Ned Konz ned at bike-nomad.com
Sat Jan 4 14:38:20 UTC 2003

On Friday 03 January 2003 11:53 pm, Bill Spight wrote:

> GoPoint>>handleMouseUp: evt
> 	self
> 		addMorph: (EllipseMorph newBounds: self bounds)
> It works. Kawabunga! Click on an intersection and a yellow circle
> appears there. :-)
> The problem comes with the next mouse click. It can be anywhere in
> the GoBoard's World and it affects the same GoPoint. Nothing is
> visible, but inspection reveals that there are multiple "stones" on
> the point. (Alt-click breaks the spell.)
> How do I get each click to register on the intersection being
> clicked?

If I understand what you're asking, the answer might be to capture the 
mouse focus until this interaction is done.

That way, your intersection will see all the mouse events.

So you'd go:

ActiveHand newMouseFocus: self.


ActiveHand releaseMouseFocus: self.

You can also set the mouse focus to some other Morph, and use 
#on:send:to: to get events from that Morph if you want.

You will probably also want to change the Cursor while you have the 
mouse focus to notify the user that the hand won't work as usual.

Ned Konz

More information about the Squeak-dev mailing list