Examples
To do this, we'll write an InstallScript which does the opening. Take an existing project and create a text file named "Auto-Open InstallScript". Add the text file to the project and then add the following InstallScript
to the file:
InstallScript := func(partFrame) begin AddDeferredCall( func() begin GetRoot().(kAppSymbol):Open(); end, nil); end;It would be nice if the
InstallScript
could just open the application with:
GetRoot().(kAppSymbol):Open();That won't work, however, because the application hasn't yet been successfully installed. We need to postpone the opening until the application has successfully been installed. We do that with
AddDeferredCall
, which, the next time the main event loop is executed, runs the function you pass it (see Newton Programmer's Guide: System). We call AddDeferredCall
in the InstallScript
, passing a function which will do the opening. By the time the function executes, the application will have been completely installed, and the Open
can be done.
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996