[Q] doubleclickable and dragable morph: how?
Ned Konz
ned at bike-nomad.com
Fri May 2 04:26:54 UTC 2003
On Thursday 01 May 2003 07:18 pm, tblanchard at mac.com wrote:
> While we are on the subject - there's something not quite kosher
> about either the double click handling or ColorPickerMorph's event
> handling. I'm trying to make a morph that, when double clicked,
> lets me pick a new color for it.
>
> subclass Morph (call it Swatch).
>
> add these methods:
>
> mouseDown: anEvent
> anEvent hand waitForClicksOrDrag: self event: anEvent.
>
> handlesMouseDown: e
> ^true
>
> doubleClick: anEvent
> self changeColor
>
> Try double clicking on it - the color picker often never appears,
> or when it does it opens and closes immediately. I think its
> pulling a mouse event it shouldn't get but I'm not having any luck
> tracking it down.
Try
doubleClick: anEvent
self color: self color darker
and you'll see that the behavior you're describing is more a result of
the Color Picker.
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|