
Declaring Views
Application Base View
The application base view is automatically declared to its parent, the root view (the application symbol is used as the slot name). The base view is created when the application is installed and deleted when the application is removed. This has an important ramification:
- Slots in the application base view retain their value even when the application is closed.
Do not be tempted, however, to save important information in the base view for later use. This information will be lost if the Newton is reset. If you want to save data, you should store it in soups (see Chapter 9, Newton Data Storage). In the base view, only store unessential information (such as what view or item the user was last looking at, or the last location of a movable window).
Since the base view remains when the application is closed, make sure to nil
out base view slots that are not needed. For example, if you create an array when the application opens, make sure to nil
out the slot in the viewQuitScript
of the base view. Otherwise, the unneeded array will exist until the application is removed.
To refer to the application base view, you can use:
GetRoot().(kAppSymbol)
"Path Expressions" on page 54 describes this syntax.
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996