Squeak/Smalltalk: Create Flasher object and openInWorld
Squeak Smalltalk comes with many built-in objects and one of the most simple and straight forward is Flasher
. It’s based on EllipseMorph
and it flashes every 500 milliseconds. The default flashing color is red, but it can be changed. This object can be seen in the objects window.
Here is how to create an instance of Flasher using objects window.
You can also find this object in the System Browser
here in case you want to see in depth details.
And finally, here is my code examples that show how to create 2 new instances of Flasher class and show them in the world.
Code Example
flasher := Flasher new.
flasher openInWorld.
greenflasher := Flasher new.
greenflasher onColor: Color green.
greenflasher openInWorld.
Demo
I hope it was helpful and makes you think differently about programming. Watch this space for more Smalltalk related articles and tutorials.
💡 Note: Please see my older article if you want to know how to get started with Squeak/Smalltalk.