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:
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
instead of your mouse pointer and a red line running from the source part to
the
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.