View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Discussion 3 (Part 1) - Arwa Tyebkhan

In detail, describe a feature of Squeak that you have found particularly useful. What is the feature? Why is it useful? How do you envoke it?

Animation in Squeak using 'Step'
Arwa Tyebkhan
gtg718m

While working on Milestone 1 of the project, I was trying to figure out how to animate the clock to make it update its time evry second. I then found that using the methods 'step' and 'stepTime' enable programmers to add liveliness to their interface by allowing objects update themselves dynamicallu.

This feature is also extremely useful as it does not lock the user or the system out while the animation is running. The animations and the user actions are concurrent.

An example of the step method and stepTime method is:

step
length := length + 1.
length > 10 ifTrue: [^ self stopStepping.].


stepTime
^1000.

In order to call the step method, you may use this line in the calling method:
self startStepping.

Now, length shall be incremented by 1 every 1000 milliseconds (as determined by the stepTime method), and the animation stops when length is greater or equal to 10.

Hence, using this, you can add interesting, useful animations and can manipulate how fast the animaton should be.

Part 2:

Discussion 3 (Part 2) - Arwa Tyebkhan

Links to this Page