[Cuis] How to center a submorph in its owner morph?

H. Hirzel hannes.hirzel at gmail.com
Wed Jan 1 15:04:37 CST 2014


Ken

you do not need to read the code anymore. I found the solution.

I have to use

#addMorph:layoutSpec:

with a layoutSpec of

   LayoutSpec keepMorphExtent.


--hjh

On 1/1/14, Ken Dickey <Ken.Dickey at whidbey.com> wrote:
> Hannes,
>
> Sorry, I don't have time to read the code right now. 8^(
>
> But the following code might be of help..
>
> Morph>>referencePosition
> 	"Return the current reference position of the receiver"
> 	"a rather ugly way to say #center . At least, we avoid false polymorphism"
> 	"remove some day"
> 	self flag: #jmvVer2.
> 	^self morphExtentInWorld // 2 + self morphPositionInWorld
>
> -KenD
>
> _______________________________________________
> Cuis mailing list
> Cuis at jvuletich.org
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>




More information about the Cuis mailing list