Parameter-from-script
Parameter-from-script connections run a script whenever a parameter to a connection is required. This connection is much the same as a parameter-from-attribute connection except that the value supplied to the connection is returned from a Smalltalk script instead of a part attribute value. For the sake of illustration, assume that we have created a simple script named stringFromScript that returns the text this is a string. An example of a parameter-from-script connection follows. Unlike other connection types, a parameter-from-script connection is initiated from the parameter name in the Connect menu choice in the connection's pop-up menu and is terminated as follows:
1. Place a Label part and a Push Button part within the default Window part in the Composition Editor.
2. Connect the clicked event of the Push Button to the object attribute of the Label part.
3. Now, create the parameter-from-script connection by connecting the value attribute from the connection pop-up menu to the script as follows:
a. Once the source attribute is selected, the mouse pointer changes to Connection mouse pointer
b. Click mouse button 1 on any open area of the free-form surface and select Parameter from script from the pop-up menu.
c. The resulting window allows you to pick from the list of existing Smalltalk scripts. In our case, the Smalltalk script named stringFromScript would appear.
d. Once you've selected a script, select OK to complete the connection or Cancel to abort the connection.
Last modified date: 06/18/2018