Sha256: 50c768a2ec5f6fe6e34d16b0d18c7b925878ce5bced6041da49aafb86629eeb0

Contents?: true

Size: 687 Bytes

Versions: 11

Compression:

Stored size: 687 Bytes

Contents

Smalltalk current createPackage: 'Examples' properties: #{}!
Widget subclass: #Counter
	instanceVariableNames: 'count header'
	category: 'Examples'!

!Counter methodsFor: 'actions'!

increase
    count := count + 1.
    header contents: [:html | html with: count asString]
!

decrease
    count := count - 1.
    header contents: [:html | html with: count asString]
! !

!Counter methodsFor: 'initialization'!

initialize
    super initialize.
    count := 0
! !

!Counter methodsFor: 'rendering'!

renderOn: html
    header := html h1 
	with: count asString;
	yourself.
    html button
	with: '++';
	onClick: [self increase].
    html button
	with: '--';
	onClick: [self decrease]
! !

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
resin-0.2.1 amber/st/Examples.st
resin-0.2.0 amber/st/Examples.st
resin-0.1.0 amber/st/Examples.st
resin-0.0.8 amber/st/Examples.st
resin-0.0.7 amber/st/Examples.st
resin-0.0.6 amber/st/Examples.st
resin-0.0.5 amber/st/Examples.st
resin-0.0.4 amber/st/Examples.st
resin-0.0.3 amber/st/Examples.st
resin-0.0.2 amber/st/Examples.st
resin-0.0.1 amber/st/Examples.st