Sha256: fdd0acf921e29017cacf204c00352e9bf167a51843f911140a750f11a90b9514
Contents?: true
Size: 686 Bytes
Versions: 6
Compression:
Stored size: 686 Bytes
Contents
Smalltalk current createPackage: 'Examples' properties: #{}! Widget subclass: #Counter instanceVariableNames: 'count header' package: 'Examples'! !Counter methodsFor: 'actions'! decrease count := count - 1. header contents: [:html | html with: count asString] ! increase 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
6 entries across 6 versions & 2 rubygems