C H A P T E R 2
Package Loading, Activation, and Deactivation
when it is moved to another store (it is deactivated then reactivated), or when the
user deletes the application icon in the Extras Drawer. Packages can also be
deactivated without removing them from the store.
When a package is removed as a result of the user deleting it from the Extras
Drawer, the system also executes the
function in each of the
package frame parts. This occurs before the
function is executed.
The following sections describe how to use these functions.
function in a package part is executed when a
package is first loaded onto a Newton store from some external source (this does
not include inserting a storage card containing the package or moving it between
stores). This function applies to all types of frame parts (for example, not store parts).
This method gives the parts in the package a chance to prevent installation of the
entire package. If any of the package parts returns a non-
value from this
function, the package is not installed and is discarded.
You should provide the user with some kind of feedback if package installation is
prevented, rather than silently failing. For example, to ensure that a package is
installed only on the internal store you could write a
function like the following:
if GetStores() <> GetVBOStore(ObjectPkgRef('foo)) then
"This package was not installed.
It can be installed only onto the internal store.");
function in a package part is executed when an application
or auto part is activated on the Newton or whenever the Newton is reset.
This function lets you perform any special installation operations that you need to
do, any initialization, and any registration for system services.