-
Notifications
You must be signed in to change notification settings - Fork 0
SLG UI Components
SLGButton new
onClickWithBlock: [
Transcript show: 'clicked!'; cr.
].
Use the
| toggleBtn |
toggleBtn := SLGToggleButtonGen new.
toggleBtn onClickWithBlock: [
toggleBtn state ifTrue: [
toggleBtn color: Color blue.
].
toggleBtn state ifFalse: [
toggleBtn color: Color green.
].
].
The background color is transparent by default.
SLGSpacer new
width: 100.
In order to display morphs in a column use the
| container submorph1 submorph2 submorph3 |
submorph1 := Morph new color: Color red; extent: 50@50.
submorph2 := Morph new color: Color green; extent: 50@50.
submorph3 := Morph new color: Color blue; extent: 50@50.
container := SLGLayout columnWithMorphs: {submorph1. submorph2. submorph3}.
container openInHand.
In order to display morphs in a row use the
| container submorph1 submorph2 submorph3 |
submorph1 := Morph new color: Color red; extent: 50@50.
submorph2 := Morph new color: Color green; extent: 50@50.
submorph3 := Morph new color: Color blue; extent: 50@50.
container := SLGLayout rowWithMorphs: {submorph1. submorph2. submorph3}.
container openInHand.
SLGText new
setText: 'Hello World!'.
SLGText new
setText: 'Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World!';
width: 400.
This class is a morph which displays a list of morphs as a so called "carousel". A carousel is a UI component which displays only one morph of the list at the time and let's the implementor call a next and back method to iterate over the the morph list.
SLGCarousel new
initializeWithMorphs:{morph1.morph2.morph3}.