Drag and Drop - strange problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Drag and Drop - strange problem

FrankBz
hi, I'm facing a strange problem in my program. Basically I have this morph which acts as a receiver of other morphs that can be dropped on it.
The behavior I want is: drag a morph on the receiver and once you drop it a method is executed and then the dropped morph disappears. This was exactly how it worked, until I decided to add a morph at initialization time ( a PasteUpMorph with a Sketch that I use as background image) . After addMorph: is executed the dropped morphs do not disappear anymore, instead they remain on the receiver morph and the method is not executed at all (just like the morph wasn't been dropped).

Does anyone know the reason behind this strange behavior?

thanks in advance
Reply | Threaded
Open this post in threaded view
|

Re: Drag and Drop - strange problem

Jerome Peace
Paste up morphs have drag and drop behavior of their own. This might be overriding the behavior you want.
In a workspace type "wantsDroppedMorph" highlight it and
then Cmd-W (cmd-shift-w)
That will browse names containing the phrase.
If you get no results try a smaller portion of the phrase. (I am good at inventive spelling).
Look at classes the implement the query. Mimic something that does what you want.

You will probably need you morph to return true to the query to get the behavior you want.

Experiment.

Yours in curiosity and service, --Jerome Peace








--- On Fri, 4/9/10, FrankBz <[hidden email]> wrote:

> From: FrankBz <[hidden email]>
> Subject: [Newbies] Drag and Drop - strange problem
> To: [hidden email]
> Date: Friday, April 9, 2010, 1:40 PM
>
> hi, I'm facing a strange problem in my program. Basically I
> have this morph
> which acts as a receiver of other morphs that can be
> dropped on it.
> The behavior I want is: drag a morph on the receiver and
> once you drop it a
> method is executed and then the dropped morph disappears.
> This was exactly
> how it worked, until I decided to add a morph at
> initialization time ( a
> PasteUpMorph with a Sketch that I use as background image)
> . After addMorph:
> is executed the dropped morphs do not disappear anymore,
> instead they remain
> on the receiver morph and the method is not executed at all
> (just like the
> morph wasn't been dropped).
>
> Does anyone know the reason behind this strange behavior?
>
> thanks in advance
> --
> View this message in context: http://n4.nabble.com/Drag-and-Drop-strange-problem-tp1819682p1819682.html
> Sent from the Squeak - Beginners mailing list archive at
> Nabble.com.
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>


     
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners