[Q] doubleclickable and dragable morph: how?

Ned Konz ned at bike-nomad.com
Fri May 9 19:30:19 UTC 2003


On Wednesday 30 April 2003 11:05 am, Rudi Angela wrote:

> I have a Morph subclass, which is dragable by default. Now I would
> also like to make it doubleclickable. But if I start adding the
> methods #handlesMouseDown, etc, then apparently I loose the
> dragability. Am I doing something wrong? Or does Morphic not
> support this combination of behaviors?

OK, after thinking about this, hearing the (very correct) warnings 
from Andreas and Lex, fixing the doubleClick logic in 
MouseClickState, etc., here's my recommendation for a 
double-clickable Morph that is also draggable. Much simpler and safer 
than overriding mouseDown: etc.

MyMorph>>initialize
	super initialize.
	self on: #doubleClick send: #changeColor to: self.
	self on: #startDrag send: #grabMe to: self

MyMorph>>grabMe
	ActiveHand grabMorph: self

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list