[Q] moving morphs without the halo

Hernan Tylim htylim at yahoo.com.ar
Mon Apr 7 20:04:00 UTC 2003


What about the following?

JacarandaShapes>>moveAllConnectedShapes
	| handle |
	handle := HandleMorph new
		forEachPointDo: [:point | | movementOffset |
			movementOffset := (self globalPointToLocal:
point) - (self position).
			self connectedShapes do: [:shape | 
				shape position: shape position +
movementOffset]].
	self currentHand attachMorph: handle.
	handle visible: false.
	handle startStepping.

The method above I use to move all the connected morphs in a Jacarandá
diagram at the same time. It uses a HandleMorph and #position: so they
aren't grabbed (picked) by the hand.

Anyway. I see that Ned had already answered you and probably his
solution is better than mine. :) 

Regards,
Hernán

> -----Mensaje original-----
> De: squeak-dev-bounces at lists.squeakfoundation.org 
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org] En 
> nombre de Martin Drautzburg
> Enviado el: Lunes, 07 de Abril de 2003 11:39 a.m.
> Para: The general-purpose Squeak developers list
> Asunto: Re: [Q] moving morphs without the halo
> 
> 
> "Hernan Tylim" <htylim at yahoo.com.ar> writes:
> 
> 
> > 		anEvent hand grabMorph: self.
> 
> This "picks up" the morph. The morph casts a shadow an is afaik
> removed from it original owning morph. Releasing the morph is another
> drop. 
> 
> The halo has two ways of moving a moroh. The back halo picks up the
> morph and the brown one just moves it without removing it from its
> owner. The latter is what I want.
> 
> You can tell the difference by unchecking "accept drops" in the owning
> morph. Then you can no longer use the black halo to move a morph
> becuase the drop at the end of the move is rejected. You can still use
> the brown halo though.
> 



More information about the Squeak-dev mailing list