Build Your First Application

Add a Slot

Now we want to add a label and a picker to the protoLabelInputLine. A label is defined by a label slot containing a string. A picker is defined by a labelCommands slot containing an array of strings. To add the slots, select the protoLabelInputLine and use the Specific popup menu (see FIGURE 2.35).

FIGURE 2.35 : The Specific popup of the protoLabelInputLine.


Now, change the contents of the label slot to "Color". Change the contents of the labelCommands slot to: ["red","green", "blue"].

Build, download, and run your application again. Tap on the Color picker. It should look like FIGURE 2.36.

FIGURE 2.36 : Application after adding new protoLabelInputLine slots.


An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.

Last modified: 1 DEC 1996