Created
January 6, 2023 12:16
-
-
Save estebanlm/860b9762477e7ccb13a0a3c081b1f70a to your computer and use it in GitHub Desktop.
showing an overlay working with morphic backend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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