Getting Started
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:
- Place a Label part and a Push Button part within the default Window part
in the Composition Editor.
- Connect the clicked event of the Push Button to the
object attribute of the Label part.
- Now, create the parameter-from-script connection by connecting the
value attribute from the connection pop-up menu to the script as
follows:
- Once the source attribute is selected, the mouse pointer changes to
- Click mouse button 1 on any open area of the free-form surface and select
Parameter from script from the pop-up menu.
- The resulting window allows you to pick from the list of existing
Smalltalk scripts. In our case, the Smalltalk script named
stringFromScript would appear.
- Once you've selected a script, select OK to complete the
connection or Cancel to abort the connection.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]