Route Scripts

The routeScripts Array

The Action button then uses that array to build the route scripts portion of the Action picker. Each item in the routeScripts array is a frame with the following slots:

title
String. The text in the Action picker. This slot shouldn't be provided if a GetTitle slot is provided.

GetTitle
func(e). Given e, the current target, returns a string to be used in the Action picker. This is a way to dynamically determine the text in the Action picker. A return result of nil specifies there is no entry for this item in the Action picker. This slot shouldn't be provided if a title slot is present.

icon
Bitmap. The nifty icon to display in the Action picker. The ROM contains icons for Duplicate and Delete-- ROM_routeDuplicateIcon and ROM_routeDeleteIcon

routeScript
func(target, targetView) or symbol. This is either directly a function, or indirectly a function (a symbol that specifies the message to send to the Action button). In either case, the function is called with the current target and targetView.


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

Last modified: 1 DEC 1996