[Q][morphic] absolute and relative coordinates
Matej Kosik
kosik at decef.elf.stuba.sk
Mon Sep 1 11:23:42 UTC 2003
On Mon, Sep 01, 2003 at 09:47:29AM +0200, Martin Drautzburg wrote:
> I have constructed morph that consists of several submorphs (circles
> and lines) and embedded this morph into an owning morph. The circles
> and lines were create with ablsolute coordinates, i.e. as if the
> upperLeft corner of my morph was 0 at 0.
>
> Once my morph is embedded into its owner its upperLeft corner
> certainly is not 0 at 0 anymore and any *new* circles and lines I add
> then end up outside the morph's bounding rectangle.
>
> I can add topLeft to all coordinates and things appear where they
> should.
Yes, #addMorph: method lets you compose morphs together in the most
simple way. You just first position the sumbmorph in a proper way
and then simple add it to the supermorph.
>
> What is the standard way of doing this, i.e. manipulationg a morph
> in-situ and contruction a morph ?
Have you seen:
http://minnow.cc.gatech.edu/squeak/2141
?
There are some examples. There is also a link to "MorphLayoutArticle"
some time ago I tried to try it unfortunatelly some of the projects
there didn't worked for me. This is perhaps due to changes in the
current/recent squeak versions. But the examples work and are
comprehensive (if you/anybody reindents the sample code (TODO)).
Additionally, there is a TableLayoutTutorial project
(as squeak map package).
(I didn't see it, but it might be worth to check).
--
Matej Kosik <http://altair.dsc.elf.stuba.sk/~kosik>
ICQ: 300133844
More information about the Squeak-dev
mailing list
|