Solved? How to code for start of drag

Ross Boylan RossBoylan at stanfordalumni.org
Fri Aug 3 18:46:59 UTC 2001


On Fri, Aug 03, 2001 at 09:20:55AM -0700, Ned Konz wrote:
> On Friday 03 August 2001 01:17 am, you wrote:
> > How do I get the code that does the first part of drag and drop to
> > kick in?  Here's a tentative answer; I welcome corrections.
> >
> > I have two morphs.  I want to click on the inner morph and, if I keep
> > the mouse down, drag it out.  I seem to be having problems getting the
> > click-drag hooked into the start of the drag code.
> 
> Are you using waitForClicksOrDrag: (look at PluggableListMorph>>mouseDown:)

No.  I'll look into it.

> 
> The parent should do the initiation of the drag. So it should use 

Why can't the morph initiate the drag itself?  And if there is a chain
of parents, which one should initiate the drag?

> 
> evt hand grabMorph: submorph.
> evt hand releaseMouseFocus: self.
> 
> > On the one hand, I thought that drag and drop was supposed to work
> > pretty automatically.  On the other, I don't see how it could: if I
> > click on a morph I may want to popup a menu, perform some action, or
> > drag it, and it seems that needs to be in the code.
> 
> enableDragNDrop is for the morph itself. If you ever want to have the drag 
> enabled state different from the drop enabled state, don't use it (use 
> enableDrag: and/or enableDrop:).

I'm not sure I understand the meaning of "for the morph itself".  The
comment on dragEnabled is
  "Get this morph's ability to add and remove morphs via drag-n-drop."
This sounds to me as if to enable me to drag morph B out of containing
morph A I must enable dragging in A.  




More information about the Squeak-dev mailing list