Monday, January 10, 2011

Petite horloge

Morphic basics with a little Watch (Horloge in french).

Add the class:
StringMorph subclass: #Horloge
 instanceVariableNames: ''
 classVariableNames: ''
 poolDictionaries: ''
 category: 'Sandbox'

One method called periodically thanks to stepping mechanism of Morphic:
 self contents: Time now printString.

Then evaluate in a Workspace:
Horloge new openInWorld.

Stop the watch:
Horloge allInstances last stopStepping

Start it again:
Horloge allInstances last startStepping

Finally close it:
Horloge allInstances last delete

1 comment: