Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save estebanlm/860b9762477e7ccb13a0a3c081b1f70a to your computer and use it in GitHub Desktop.
Save estebanlm/860b9762477e7ccb13a0a3c081b1f70a to your computer and use it in GitHub Desktop.
showing an overlay working with morphic backend
app := SpApplication new.
app addStyleSheetFromString: '.application [
.green [
Draw {
#backgroundColor: #16A085
}
],
.redOverlay [
Draw { #backgroundColor: #C0392BBB },
Geometry { #height: 150, #width: 150 }
],
.title [ Font { #size: 40, #bold: true },
Geometry { #height: Reset, #width: Reset } ]
]'.
presenter := SpPresenter newApplication: app.
child := presenter newPresenter
layout: (SpBoxLayout new
hAlignCenter;
vAlignCenter;
add: ('I AM THE CHILD' asPresenter
addStyle: 'title';
yourself);
yourself);
addStyle: 'green';
yourself.
overlay := presenter newPresenter
layout: SpBoxLayout newVertical;
addStyle: 'redOverlay';
yourself.
presenter layout: (SpOverlayLayout new
child: child;
addOverlay: overlay withConstraints: [ :c |
c
vAlignCenter;
hAlignCenter ];
yourself).
presenter open.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment