[Q] Making a button immune to mouse clicks

Ned Konz ned at bike-nomad.com
Sun Apr 14 14:08:27 UTC 2002

On Sunday 14 April 2002 12:18 am, Martin Drautzburg wrote:
> I want the Button to be event-wise a lot bigger than the visible
> Button. I want a large Rectangle with a small Button in it. In the
> remaining space in the Rectangle I want to put other things, but I
> want to be able to drag the whole thing around with the button.

Any plain Morph (one that doesn't override handlesMouseDown: and 
mouseDown: et. al.) can be sensitized to mouse clicks. Just say:

myMorph on: #mouseDown send: #doSomething to: someObject.

Same for the events mouseMove, mouseStillDown, mouseUp, mouseEnter, 
mouseLeave, mouseEnterDragging, mouseLeaveDragging, click, 
doubleClick, doubleClickTimeout, startDrag, keyStroke, and gesture.

> How can I possibly drag a button without invoking the mouse action
> ? AFAIK a drag always sends a click first.

You can drag a button using its brown Morph halo handle.
Or you can hold down the control key and drag (this will bring up the 

Ned Konz

More information about the Squeak-dev mailing list