[Newbies] Re: Programmatically simulating drag and drop

Bert Freudenberg bert at freudenbergs.de
Tue Apr 6 17:32:11 UTC 2010

On 06.04.2010, at 19:02, Sean P. DeNigris wrote:
> Bert Freudenberg wrote:
>> How detailed do you need the simulation to be? In the end, dropping
>> results in 
>> 	targetMorph addMorph: droppedMorph
> Thanks.  I tried it and it didn't work because what I'm doing is writing an
> acceptance test, and I need the drag & drop events to fire.  When I do that
> only, it just adds the "dropped morph" as a sub-morph to the target.

How about this?

	droppedMorph formerPosition: 50 at 50.	"to test rejecting"
		position: targetMorph center;
		attachMorph: droppedMorph;

> Also, I'm highly curious about how to programmatically interact with the
> HandMorph in general.  I looked at HandMorphForReplay a little bit, but it
> seems to use recording of positions (which would be too brittle for a
> high-level test).

Your best bet would be to subclass HandMorph similar to HandMorphForReplay or RemoteHandMorph.

- Bert -

More information about the Beginners mailing list