Changes to mouseUp handling?

Ned Konz ned at bike-nomad.com
Tue Nov 7 18:02:17 UTC 2000


Lex Spoon wrote:

> Your connector application certainly is different from most drag and
> drop applications.

I know. I wonder if it isn't a bad idea to do what I'm doing, given
the resistance from Morphic.

> 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!

Yes, though the way the AttachmentPoints work is that they become
sub-morphs of their host morph. This can cause problems with morphs that
assume something about their submorphs, like lists (or even AlignmentMorphs).

Now that the event re-work is more or less complete, I'm going to go back
and see if I can't make a more QuickDraw-like scheme work (though it may
require having a separate World with its own Hand and rules for dispatching).

I was trying to avoid having to require special kinds of morphs participate
in my drawings.

> 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!

I've actually done this in testing, to make tools work. I'll go back to
trying it.

> 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.

Yes. Right now the Hand asks the World what to do in the case where
the drag'n'drop doesn't get accepted. The limitation of that is that it
makes it hard to make an editor that works in a window (haven't looked
at the world-in-world stuff yet, though).

> 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.

That's a good suggestion; I'll look at it.

Thanks!
-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com





More information about the Squeak-dev mailing list