Niko Schwarz puso en su mail :
>From a old code, this read the attached file and produce the attached pict.
!GreetingMorph methodsFor: 'initialization' stamp: 'edc 9/28/2004 07:37'!
chooseColor
| buttons b max maxX x y cuenta |
ColoresCrayon ifEmpty: [self class readColoresCrayonFromFile].
buttons := OrderedCollection new.
paleta := PasteUpMorph new.
paleta layoutPolicy: nil.
paleta hResizing: #rigid.
paleta vResizing: #rigid.
paleta borderWidth: 2.
paleta borderColor: Color black.
paleta color: Color white.
.
maxX := 0.
x := 0.
y := 0.
cuenta := 0.
ColoresCrayon keysAndValuesDo: [ :name :rgb|
b := (SimpleButtonMorph new label: name;
color: rgb ;
target: self;
actionSelector: #backColor:;
arguments: (Array
with: rgb) ).
buttons add: b].
b := (SimpleButtonMorph new label: 'Enough Fun ?';
color: Color white;
target: self;
actionSelector: #killFrontDialog).
buttons add: b.
"Compute the max width"
max := 0.
buttons do: [:each | max := each width max: max].
"Set all widths to the max value"
buttons do: [:each | each width: max].
buttons
reverseDo: [:each |
each position: x@y.
paleta addMorph: each.
cuenta < 7
ifTrue: [x := x + each width.
cuenta := cuenta + 1]
ifFalse: [y := y + each height.
x > maxX
ifTrue: [maxX := x].
x := 0.
cuenta := 0.
]].
maxX := maxX + 10 .
y := y + 10.
paleta extent: maxX @ y.
paleta position: 30@30 .
paleta becomeLikeAHolder.
paleta openInWorld.
[done] whileFalse: [
World doOneCycle]
>>> I left readColoresCrayonFromFile as exercise or you could grab
>
> Morphic-Greeting.003.pr ( Squeaklets folder) And you could amaze friends and
> foes sending Squeak made cards with picts and music.
>
> From ftp://
[hidden email]/
> password: elpelotero (on approximate 09:00 to 23:00 GMT, dig and take what
> you like, at your own risk)
Cheers
Edgar