[Cuis-dev] How do I center a morph in a table cell?

H. Hirzel hannes.hirzel at gmail.com
Wed Feb 12 10:49:24 PST 2025


Hello

I want a table cell extent to be defined in absolute values and the 
content should be centered.

What I have so far is

             cellContentExtent := (5 to: 80) atRandom asPoint.
             cellContent := (ColoredBoxMorph new ::  morphExtent: 
cellContentExtent; color: Color random).

             tableCell := (LayoutMorph newRow ::  morphExtent: 100 at 100; 
color: Color blue).
             tableCell addMorph: cellContent layoutSpec: (LayoutSpec 
fixedExtent: cellContentExtent).
             tableCell openInWorld

How do I tell the tableCell layoutMorph to center its content?

Regards

Hannes



More information about the Cuis-dev mailing list