Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Fake scripting
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|
b := SimpleButtonMorph new.
b label: 'Load updates'.
b target: [HTTPSocket httpFileIn: 'http://example.com/squeak-updates.st'.].
b actionSelector: #value.
b openInWorld.


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.

Jeff Read