[squeak-dev] how to attachMorph: at the corner?

Bob Arning arning315 at comcast.net
Tue May 28 22:56:59 UTC 2013


(r _ RectangleMorph new extent: 500 at 500)
     openInHand;
     position: r center

Cheers,
Bob

On 5/28/13 6:05 PM, Chris Muller wrote:
> I'm using #openInHand, which opens my morph, centered under the hand.
> I want to open it in the hand, but attached near the upper left corner
> rather than the center.
>
> To do this, I factored the temp var "delta" calculation out of
> HandMorph>>#attachMorph:, so it would take an argument instead,
> attachMorph: aMorph at: delta.  Regular attachMorph now calls it
> passing in the center point.
>
> Now I have an attach API that accepts an offset, guess I just need to
> support openInHand: offset to call the new #attachMorph:at:.
>
> (Sigh) It works but is there a better way to do this?
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130528/65fd4eb3/attachment.htm


More information about the Squeak-dev mailing list