Hi,

It worked. For center the morph I do it in the naive way. I called the method 
position: of the morph.
Thanks,
Sebastian Jordan
________________________________
De: Pharo-users <pharo-users-boun...@lists.pharo.org> en nombre de Esteban 
Lorenzano <esteba...@gmail.com>
Enviado: jueves, 19 de marzo de 2020 05:25
Para: Any question about pharo is welcome <pharo-users@lists.pharo.org>
Asunto: Re: [Pharo-users] Morphs with Spec2

Hi,

1. Spec styles define a “default” font applied to all components (morphs in 
this case) that understand font, and if you want to change it you need to 
define your own style.
2. A string morph cannot center the string (this is a morphic stuff)

You can solve your problem by adding a PanelMorph instead a string:

obtainSpMorphPresenterwithAStringMorph
    | morph |
    morph := StringMorph
    contents: 'A String Morph'
    font:
        (LogicalFont
            familyName: Smalltalk ui theme labelFont familyName
            pointSize: Smalltalk ui theme labelFont pointSize + 10).
    ^ SpMorphPresenter new
    morph: (PanelMorph new
addMorphBack: morph;
yourself);
    yourself


This will produce this morph:

[cid:4B595F37-F62E-4AD8-9D0E-515284AC24C4]


And since I hate morphic, I will let you to fight with morph to center your sub 
morph ;)

Esteban

On 18 Mar 2020, at 17:41, Sebastian Jordan 
<sebastian...@hotmail.com<mailto:sebastian...@hotmail.com>> wrote:


    button1 := self newButton.

Reply via email to