Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
StandardScriptingSystem
Last updated at 2:25 am UTC on 9 October 2016
The class StandardScriptingSystem has a sole instance which is in the global variable "ScriptingSystem".

It is initialised by
Smalltalk makeSqueaklandRelease.

The method #makeSqueaklandRelease has to be called manually; there is no sender in the system.

The code of this method is under Smalltalk makeSqueaklandRelease.

ScriptingSystem inspectFormDictionary
opens the form dictionary of icons used in Morphic.

The StandardScriptingSystem object is mainly used by the etoy programming environment.

However for general use as well it has the class variables

And the methods of general use are

If you want to discard the Morphic scripting system by executing

SystemOrganization removeSystemCategory: 'Morphic-Scripting Tiles'.

SystemOrganization removeSystemCategory: 'Morphic-Scripting'.

SystemOrganization removeSystemCategory: 'Morphic-Scripting Support'.


you have to provide a replacement before.

To do this file in the code below and then execute
MiniScriptingSystem formDictionary: ScriptingSystem formDictionary.

ScriptingSystem initializeHelpStrings.

ScriptingSystem _ MiniScriptingSystem new.




'From Squeak3.2alpha of 1 November 2001 [latest update: #4599] on 19 January 2002 at 3:59:03 pm'!
Object subclass: #MiniScriptingSystem
instanceVariableNames: ''
classVariableNames: 'FormDictionary HelpStrings '
poolDictionaries: ''
category: 'HH'!

MiniScriptingSystem methodsFor: 'as yet unclassified' stamp: 'HJH 1/19/2002 15:38'!

formAtKey: aKey
"ScriptingSystem saveForm: (TileMorph downPicture) atKey: 'downArrow'"
^ FormDictionary at: aKey asSymbol ifAbsent: [nil]! !

MiniScriptingSystem methodsFor: 'as yet unclassified' stamp: 'HJH 1/19/2002 15:38'!

formAtKey: aKey extent: extent depth: depth
"ScriptingSystem saveForm: (TileMorph downPicture) atKey: 'downArrow'"
^ FormDictionary at: aKey asSymbol ifAbsent: [Form extent: extent depth: depth]! !

MiniScriptingSystem methodsFor: 'as yet unclassified' stamp: 'HJH 1/19/2002 15:36'!

formDictionary
^FormDictionary! !

MiniScriptingSystem methodsFor: 'as yet unclassified' stamp: 'HJH 1/19/2002 15:37'!

formDictionary: aDictionary
FormDictionary _ aDictionary! !

MiniScriptingSystem methodsFor: 'as yet unclassified' stamp: 'HJH 1/19/2002 15:57'!

helpStringFor: aSymbol
^ HelpStrings at: aSymbol ifAbsent: ['No help yet available for ', aSymbol]! !

MiniScriptingSystem methodsFor: 'as yet unclassified' stamp: 'HJH 1/19/2002 15:57'!

helpStringOrNilFor: aSymbol
"If my HelpStrings dictionary has an entry at the given symbol, answer that entry's value, else answer nil"

^ HelpStrings at: aSymbol ifAbsent: [nil]! !

MiniScriptingSystem methodsFor: 'as yet unclassified' stamp: 'HJH 1/19/2002 15:58'!

initializeHelpStrings
"Initialize the data structure that determines, for the etoy system, help messages for various scripting elements. The structure is built up by letting every Morph subclass contribute elements simply by implementing method #helpContributions. Consult implementors of #helpContributions for examples of how this goes."

"ScriptingSystem initializeHelpStrings"

| aDictionary |
aDictionary _ IdentityDictionary new.
"For safety, the new copy is built up in this temp first, so that if an error occurs during the creation of the structure, the old version will remain remain in place"

Morph withAllSubclasses do:
[:aClass | (aClass class selectors includes: #helpContributions)
ifTrue:
[aClass helpContributions do:
[:pair | aDictionary at: pair first put: pair second]]].

HelpStrings _ aDictionary! !

"– – – – – – – – – – – – – – – – – – "!

MiniScriptingSystem class
instanceVariableNames: ''!

MiniScriptingSystem class methodsFor: 'as yet unclassified' stamp: 'HJH 1/19/2002 15:39'!

formDictionary: aDictionary
FormDictionary _ aDictionary! !