[Q] doubleclickable and dragable morph: how?

tblanchard at mac.com tblanchard at mac.com
Fri May 2 05:50:19 UTC 2003


True - but its not quite so simple.  There's a more complicated 
interaction between the ColorPickerMorph and the double click tracking. 
  For instance, if I put changeColor in click: rather than doubleClick:, 
then it works OK - except that I want it to happen on a double click 
because I'm using click for something else.


On Thursday, May 1, 2003, at 10:26  PM, Ned Konz wrote:

> 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