[Cuis-dev] Build GUI with rotated morph

Hilaire Fernandes hfern at free.fr
Sat Mar 22 03:37:06 PDT 2025


Hi,

I try this script bellow: the rotated morph is outside of the owner, 
which seems logical considered how is intended the BoxMorph behavior. 
Rotating in the other direction get the morph inside the owner bounds, 
but its extent is then no-sense.

I am suspecting it is not possible to build GUI with Morphs affine 
transformed. It is likely an uneasy topic because you will have 
rectangular bounding with sides not parallel to each others and to the x 
and y screen axis as well. Under that circumstance,  layout may be 
complicated, or even impossible.

| button tm1 tm2 tm3 row |

     tm1 := TextModelMorph withText: 'Some random text'.
     button := PluggableButtonMorph model: [] action: #value label: 
'Click Me'.
     tm2 := TextModelMorph withText: 'Some other random text'.
     tm3 := TextModelMorph withText: 'I am passive, and disabled user 
edit' ::
         disableEditing;
         morphExtent: 400 at 50;
         rotation: Float halfPi .
     row := LayoutMorph newRow.
     row addMorph: tm3 ;
         addMorph: (LayoutMorph newColumn ::
             addMorph: tm1 ;
             addMorph: button;
             addMorph: tm2 ).

     SystemWindow new
         setLabel: 'TextModelMorphDemo';
         addMorph: row;
         openInWorld.

-- 
http://mamot.fr/@drgeo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250322/6072437e/attachment.htm>


More information about the Cuis-dev mailing list