[squeak-dev] morph selector x: x and y: y

Bert Freudenberg bert at freudenbergs.de
Tue Mar 5 11:32:27 UTC 2013


On 2013-03-05, at 08:46, Nicolai Hess <nicolaihess at gmail.com> wrote:

> Hi,
> 
> someone knows why Morphs selector x x: and y y: are implemented differently?

Yes.

> Morph y and y: testing wether self world is nil whereas x and x: doesn't.

That's because the y coordinate does not need to be flipped.

As Marcel wrote, these should be moved to the Etoys package.

> Btw. what is the preferred way to position morphs relative
> to the bounds of its owner. It seems morph positions are always
> absolute coordinates.

The preferred way would be to use a layout.

A common way for absolute positioning is to add the children while the parent is still at 0 at 0.

Or, just embrace global coords:

	child center: parent center.

(similar for other setters like #topLeft etc)

- Bert -




More information about the Squeak-dev mailing list