Changes to mouseUp handling?

Lex Spoon lex at cc.gatech.edu
Tue Nov 7 17:42:06 UTC 2000


Ned Konz <ned at bike-nomad.com> wrote:
> Ah. I saw the following comment in justDroppedInto:event:
> 
> 	This message is sent to a dropped morph after it has been dropped 
> 	on--and been accepted by--a drop-sensitive morph
> 
> and assumed that it meant that the morph being dropped on would have to
> accept the morph. However, that won't work for me (as I said) because
> the AttachmentPointMorphs should work with ANY Morph (including, say,
> a RectangleMorph, which generally doesn't accept anything being dropped
> onto it).
> 
> In fact, I'd like to suppress the entire drag'n'drop behavior if I could,
> and just get a mouseUp.
> 

Your connector application certainly is different from most drag and
drop applications.  In most cases, it makes sense to ask the morph being
dropped on what should happen.  But in this case, you want to ask the
morph that's being dropped.  Note that even if you do force your morph
to get dropped in the right place, it would currently trigger actions
that you don't want to happen.  For example, if you drop into a
ListMorph, the list might try to add your connector morph to the list!  

In solving this, it would be nice if mouseUp: and mouseDown: can be kept
at a lower level than the drag and drop events.  In fact, it doesn't
necessarily have to be a mouseUp: that triggers a drop, anyway.  Imagine
a button that, when clicked, attaches a morph to the hand!  Or imagine a
future hand which picks up morphs after a full down-up click.  This kind
of thing should be allowed, but it won't work if there is drag and drop
code that assumes specific kinds of mouseDown and mouseUp events are
going to be triggering the drag and drop.


So what to do.  We could extend morphic so that when a morph is about to
be dropped, then the dropped morph is first asked if it wants control
over the drop.  Most morphs will say no, but Ned's would say yes.  Only
if morphs say no, would a hand morph look around for a morph to accept
the drop and take control.  It's yet one more addition to the protocols,
but drag and drop just plain seems to be complicated.


-Lex





More information about the Squeak-dev mailing list