[Cuis-dev] custom morph with fixed size

Mark Volkmann r.mark.volkmann at gmail.com
Mon Aug 12 15:13:22 PDT 2024


See the attached screenshot. Hard as I try, I haven't been able to figure
out why the two red squares are different sizes. They are instances of a
custom morph named PlaceholderMorph.

Here is the code I run in a Workspace to produce the screenshot:

model := Switch new.
b1 := (PluggableButtonMorph model: model action: #demo) label: 'X'.
b2 := (PluggableButtonMorph model: model action: #demo) label: 'X'.

col := LayoutMorph newColumn.

row := LayoutMorph newRow.
row color: Color white.
row addMorph: PlaceholderMorph new.
row addMorph: (LabelMorph new contents: 'Short').
row addMorph: b1.
col addMorph: row.

row := LayoutMorph newRow.
row color: Color white.
row addMorph: PlaceholderMorph new.
row addMorph: (LabelMorph new contents: 'Longer').
row addMorph: b2.
col addMorph: row.

col openInHand.

A fileOut of the very basic PlaceholderMorph class is also attached.

-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240812/96b6ef45/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2024-08-12 at 5.09.24?PM.png
Type: image/png
Size: 4767 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240812/96b6ef45/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PlaceholderMorph.st
Type: application/octet-stream
Size: 612 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240812/96b6ef45/attachment.obj>


More information about the Cuis-dev mailing list