How Do I ... : Write Smalltalk scripts : Connect scripts and parts to add function
Connect scripts and parts to add function
Save a scriptSave a scriptNo tip for this topicC:\Users\documentation\Documents\vastePublisher\stable\VAS Documentation Word\images\hdixmp.gifTest my scriptTest my script
You can have nonvisual parts (classes) that consist solely of scripts. However, you'll likely use scripts to add function to your visual parts.
To use scripts with visual parts, you connect the scripts and parts in a Composition Editor open on the parts. There are two types of script connections that you can use:
Drawing the connection
To draw a connection between a script and a visual part:
1. Using mouse button 2 (or 3) , click on the part from which you want to begin a connection (the source part).
2. From the source part's displayed pop-up menu, select Connect > <attribute, event, or action>.
If the pop-up menu doesn't list the specific attribute or event that you want, select All features. Selecting All features opens a Connections window that lists all attributes, events, and actions of a part. In this window, select an attribute or event, and click on OK.
Once you make the selection, you'll see spiderinstead of your mouse pointer and a red line running from the source part to the spider
3. Click on the free-form surface.
4. From the displayed pop-up menu, select More.
5. In the displayed window, do the following:
a. Select the class (part) that holds your script from the drop-down list in the middle of the window.
b. From the list of scripts at the bottom of the window, select your script. If it's not shown and your script is private, click on the public push button so it toggles to private and shows private scripts in the class.
c. Select OK.
An event-to-script connection is, by default, a green, single-headed arrow pointing to the edge of the free-form surface. An attribute-to-script connection is, by default, blue with a hollow dot at one end.
Last modified date: 08/09/2019