NewtApplication

Optional Slots

These slots are not required in a NewtApp but are necessary if you want your application to support the services associated with them.

dateFindSlot
Symbol. This symbol (or path expression) specifies an indexed date slot in your soup entries. This is used to implement Date Find. An example value is 'creationDate. If you don't have an indexed date slot (aren't supporting Date Find), you should nonetheless add a DateFind slot with the value nil to your newtApplication. By doing so, you will override the default DateFind method provided by newtApplication, and thereby disable Date Find.

doCardRouting
nil, true, or 'onlyCardRouting. If true, the folder slip contains buttons for moving the selected item to a particular store. If nil, the folder slip doesn't contain a way to change the store. If 'onlyCardRouting, the folder slip contains no folder controls, but does have buttons to change the store. The default value is true.

statusBarSlot
Symbol. This specifies the name of your declared newtStatusBar. This is essential if the buttons in your status bar need to differ depending on the layout. This slot must be provided for a layout to override the buttons in the status bar. An example value might be 'myStatusBar.

aboutInfo
Frame. This is a frame that is used to build the default About slip. Its slots are tagLine, version, copyright, and trademarks, and each holds a string. FIGURE 10.3 shows a sample About slip based on this frame.

FIGURE 10.3 : Customized About slip.


aboutView
Frame. You use this template frame when you wish to create a totally custom About slip. NewtApp will create a view from this template if the user chooses "About" from the info button. Only provide this slot if you want to completely replace NewtApp's default About slip.

prefsView
Frame. This is the template used for the Preferences slip. NewtApp will create a view based on it if the user chooses "Prefs" from the info button. Provide this slot if you want to completely replace NewtApp's default Prefs slip. Make sure that you read the preferences frame when the slip opens with GetAppPreferences. You should also store your custom preferences in a subframe with your application symbol as the slot name (to avoid conflict with NewtApp preferences). When the slip is closed, call SaveAppState to save the preferences frame.

The following three slots are used for stationery (see Chapter 11, Stationery).

superSymbol
Symbol. This symbol is used to determine which stationery are supported in the application. The dataDefs whose superSymbol matches this superSymbol will appear in the New button. The default value for this slot is 'notes.

allDataDefs
Frame. In this frame, you register your dataDefs. The slot name for each slot is a dataDef symbol and its value is a dataDef frame. Here is an example:
{
|MyDataDef1:Calliope|: GetLayout("dataDef1.t"),
|MyDataDef2:Calliope|: GetLayout("dataDef2.t"),
}

For better maintainability, you should rewrite this code to use defined constants for the dataDef symbols:
f := {};
f.(kDataDef1Symbol) := GetLayout("dataDef1.t");
f.(kDataDef2Symbol) := GetLayout("dataDef2.t");
f;
(For information on this unusual syntax see "Registering with NewtApp" on page 333).

allViewDefs
Frame. You register viewDefs in this frame. Each slot name is a dataDef symbol. Each value is a frame containing viewDefs that should be registered for that dataDef symbol. Here is an example:
{
|MyDataDef1:Calliope|: {
default: GetLayout("view1Editor.t"),
print: GetLayout("view1Print.t"),
}
}

For better maintainability, you should rewrite this code to use defined constants for the dataDef and viewDef symbols:
f := {};
f.(kDataDef1Symbol).(kViewDef1EditorSymbol) := GetLayout("view1Editor.t");
f.(kDataDef1Symbol).(kViewDef1PrintSymbol) := GetLayout("view1Print.t");
f;
(For information on this syntax see "Registering with NewtApp" on page 333).


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

Last modified: 1 DEC 1996