[Q] PasteUpMorph (World)
Ned Konz
ned at bike-nomad.com
Tue Mar 25 18:35:43 UTC 2003
On Tuesday 25 March 2003 10:02 am, Brian Brown wrote:
> I've played around with setting the instance variables:
> autoLineLayout and resizeToFit in conjunction with the method
> convertAlignment; my intent being to have the World PasteUpMorph
> automatically lay out submorphs that I add in a project.
>
> If I set autoLineLayout to true, it almost does what I want, but...
>
> There is one piece of behavior that I can't figure out... when any
> of of the submorphs are clicked, that morph is moved to the upper
> left corner and the morphs are all layed out again. Is there a way
> I can follow the messages to see when this behavior is invoked?
What's happening is this: when you click on a Morph, the Hand picks it
up, removing it from the PasteUpMorph. Then when you release the
mouse, the Hand drops it, adding it to the PasteUpMorph. So the PUM
re-lays out.
Sounds like what you need is for a PUM that knows that it just had a
particular Morph (perhaps via a WeakKeyDictionary), and can put that
Morph back at the right place in its submorphs list.
The reason for a WeakKeyDictionary versus just a single variable is
that you could grab multiple Morphs at once using a SelectionMorph
(and then lay them back down).
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|