Copying Morphs and global/local coordinates?

Peter Munro munro at cognality.com
Fri Mar 2 10:17:28 UTC 2001


[VM: Squeak 3.0 (release build 1); Image: Squeak3.0final]

I want a to copy a morph when I start dragging (a la Mac/Windoze
Finder/Explorer).

In my #startDrag:, I'm doing:
    event hand grabMorph: self veryDeepCopy

If I drag a copy from within an AlignmentMorph, the new copy is attached
to the HandMorph as I'd expect, with the cursor arrow tip directly on
the morph..

But if I put the AlignmnentMorph in a ScrollPane, the new copy is
dragged, but offset from HandMorph (ie cursor tip is far away from morph
it is dragging). The offset appears to correspond to the offset of the
ScrollPane from the top-left of the world.

After inspecting I see that the ScrollPane and TransformMorph have
bounds appropriate to their position within the world, and the
AlignmentMorph has a topLeft of 0 at 0.

So:
  1. Am I creating a new copy of the morph in the right way? (Dragging
     the original works fine.) Should I be instantiating a new morph
     from scratch?

  2. How do I get it to work?!

  3. Which component should (really) be responsible for adjusting
     a morph's position when changing coordinate systems?


Many thanks in advance!
Cheers,
Pete

----
Peter Munro
-------------- next part --------------
A non-text attachment was scrubbed...
Name: munro.vcf
Type: text/x-vcard
Size: 288 bytes
Desc: Card for Peter Munro
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010302/af4ca9eb/munro.vcf


More information about the Squeak-dev mailing list