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

Mark Volkmann r.mark.volkmann at gmail.com
Wed Feb 12 12:48:15 PST 2025


On Wed, Feb 12, 2025 at 1:44 PM H. Hirzel via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> 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?
>

Does it work to add this?

tableCell axisEdgeWeight: 0.5.

-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250212/127961a1/attachment.htm>


More information about the Cuis-dev mailing list