Solved? How to code for start of drag
Ned Konz
ned at bike-nomad.com
Fri Aug 3 16:20:55 UTC 2001
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:)
The parent should do the initiation of the drag. So it should use
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:).
Look at PluggableListMorph>>startDrag:
--
Ned Konz
currently: Stanwood, WA
email: ned at bike-nomad.com
homepage: http://bike-nomad.com
More information about the Squeak-dev
mailing list
|