The Inspector’s Events page displays the events to which the current object can respond. When you select an event, its value area becomes a text box with a tool button.

To specify what you want to happen when an event occurs, you can do one of the following:

  1. Type a code block into the text box for the event. Or, if you want to use the Code Block Builder,

Click the Type image\TYPETOOL.gif drop-down list beside the text box, and select CodeBlock.

Click the wrench tool image\WRENCH.gif beside the text box.
This opens the Code Block Builder. Type parameters, if any, in the Parameters text box, and type the code block in the Commands Or Expression box. It’s okay to put only one statement on each line, and end it with a semicolon, where appropriate. When you click OK, the code block becomes a one-line code block in the event’s value text box and in your code.

  1. Write a method to link to the event. Click the tool button to display the Source editor with the cursor inside the skeleton of a new method, ready for you to type.