Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Morphic Step
Last updated at 2:42 pm UTC on 16 January 2006
If a morph implements a method
#step
, then that method will be called once every second (XXX is this the default?) as long as it is open in an active morphic world. To change the update period, modify the method
#stepTime
to return a different number of seconds.

This has been extended recently in Squeak 3.1. Anyone care to describe the extensions? Nowadays, you can have multiple step timers...

One twist on
#step
is that the model of a SystemWindow can also be stepped. The relevant methods are
#wantsStepsIn:
and
#stepIn:
.

The primary use of
#step
is probably to make animated morphs which update their appearance periodically. However, it is a general mechanism that allows some interesting designs. In particular, anywhere that a thread would normally be used, one can consider polling from
#step
instead. The downside is that there is more latency between polls; the upside is that the method has no synchronization worries, and in particular it can freely make changes to the current morphic world.