'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 15 May 2007 at 10:22:07 am'! Object subclass: #Compteur instanceVariableNames: 'compteur' classVariableNames: '' poolDictionaries: '' category: 'Cours-Smalltalk-GUI'! !Compteur methodsFor: 'as yet unclassified' stamp: 'hw 4/18/2006 14:57'! ajoute: unNombre compteur := compteur + unNombre. self changed: #printString! ! !Compteur methodsFor: 'as yet unclassified' stamp: 'hw 4/18/2006 13:19'! compte: unObjet compteur:= unObjet asNumber. ^true! ! !Compteur methodsFor: 'as yet unclassified' stamp: 'hw 2/14/2006 11:00'! decremente self ajoute: -1! ! !Compteur methodsFor: 'as yet unclassified' stamp: 'hw 2/14/2006 11:00'! incremente self ajoute: 1! ! !Compteur methodsFor: 'as yet unclassified' stamp: 'hw 4/18/2006 13:19'! initialize compteur := 0! ! !Compteur methodsFor: 'as yet unclassified' stamp: 'hw 4/18/2006 14:18'! openInWorld | window butonIncrement boutonDecrement display | window := MySystemWindow labelled: 'Compteur'. window model: self. butonIncrement := PluggableButtonMorph new model: self; action: #incremente; label: '+' font: (StrikeFont familyName: 'Atlanta' size: 22); borderWidth: 2. boutonDecrement := PluggableButtonMorph new model: self; action: #decremente; label: '-' font: (StrikeFont familyName: 'Atlanta' size: 22); borderWidth: 2. display := (PluggableTextMorph on: self text: #printString accept: #compte:) font: (StrikeFont familyName: 'Atlanta' size: 22). window addMorph: display frame: (0 @ 0 extent: 1 @ 0.5). window addMorph: butonIncrement frame: (0 @ 0.5 extent: 0.5 @ 0.5). window addMorph: boutonDecrement frame: (0.5 @ 0.5 extent: 0.5 @ 0.5). window openInWorld! ! !Compteur methodsFor: 'as yet unclassified' stamp: 'hw 4/18/2006 13:19'! printOn: aStream aStream nextPutAll: compteur printString ! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! Compteur class instanceVariableNames: ''! !Compteur class methodsFor: 'initialisation' stamp: 'hw 2/14/2006 10:56'! new ^ super new initialize! ! !Compteur class methodsFor: 'initialisation' stamp: 'hw 2/14/2006 10:57'! openInWorld ^ self new openInWorld! !