[Cuis-dev] Box Morph video - PadWorkSpace.st

H. Hirzel hannes.hirzel at gmail.com
Tue Nov 12 08:02:34 PST 2024


Hello

I was watching the Box Morph video (Sep 2024, link is on
https://cuis.st/community) with interest.

I like that padding works similar to CSS.

Below is the workspace code used for the demo four your convenience in case
you need it.

Regards
Hannes

----------------------------------------------
File: PadWorkSpace.st
----------------------------------------------



labelMorph := LabelMorph new
  borderWidth: 2;
  borderColor: Color red;
  color: Color cyan;
  padding: 0.

imageMorph := ImageMorph new
   borderWidth: 6;
   borderColor: Color green;
   padding: 0.

layoutMorph := LayoutMorph new
    borderWidth: 2;
    borderColor: Color yellow;
    padding: 0;
    separation: 0;
    addMorph: labelMorph;
    addMorph: imageMorph;
    scaleBy: 3;
    openInWorld.

labelMorph := LabelMorph newColumn
  borderWidth: 2;
  borderColor: Color red;
  color: Color cyan;
  padding: 0.

imageMorph := ImageMorph new
   borderWidth: 6;
   borderColor: Color green;
   padding: 0.

layoutMorph := LayoutMorph new
    borderWidth: 2;
    borderColor: Color yellow;
    padding: 0;
    separation: 0;
    addMorph: labelMorph;
    addMorph: imageMorph;
    scaleBy: 3;
    openInWorld.


labelMorph := LabelMorph new
  borderWidth: 2;
  borderColor: Color red;
  color: Color cyan;
  padding: 0.

imageMorph := ImageMorph new
   borderWidth: 6;
   borderColor: Color green;
   padding: 0.

layoutMorph := LayoutMorph newColumn
    borderWidth: 2;
    borderColor: Color yellow;
    padding: 0;
    separation: 0;
    addMorph: labelMorph;
    addMorph: imageMorph;
    scaleBy: 3;
    openInWorld.

labelMorph padding: 4.

labelMorph padding: 6.

labelMorph padding: 8.

layoutMorph padding:0; morphExtent: layoutMorph minimumExtent.

layoutMorph padding:0; morphExtent: layoutMorph minimumExtent.

layoutMorph separation: 3.

LayoutMorph exampleEdgesColumn.
LayoutMorph exampleEdgesRow.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20241112/cd7a0352/attachment.htm>


More information about the Cuis-dev mailing list