Last updated at 1:14 am UTC on 17 January 2006
You can write "fake scripts" for some kinds of objects, avoiding the need for Players, by setting BlockContexts as the target for pluggable morphs. For example, let's say you want to load a remote piece of code from a project:
b := SimpleButtonMorph new.
b label: 'Load updates'.
b target: [HTTPSocket httpFileIn: 'http://example.com/squeak-updates.st'.].
b actionSelector: #value.
You can have a lot of fun with this. In this way, you can create "scripts" behind buttons and other pluggable morphs that do just about anything. The blocks that are attached to the buttons will be saved and loaded with your project, just like any other object.