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