C H A P T E R 2 1
. Nor should you use
, or any other method
that directly references the routing format. This is because the entire
function is passed to
(for application parts).
Your routing format layouts would be copied into the NewtonScript heap, wasting
Instead, you should use an indirect method to reference your routing format
layouts. One way is to store a reference to your routing format layouts (by using
) in a slot in your application base view (for example,
). Then in the
function, you can reference
that slot through the expression
Because the reference to the layout is found at run time through an argument to
, it is not copied into NewtonScript memory by
when your application is installed.
For example, first you could store the routing format layout in an application base
Then in the
function, you could use code like this to register the
local myApp := partFrame.theForm;
For more information about view definitions and the functions that act on them,
refer to Chapter 5, "Stationery."
If your application uses the NewtApp framework, registering
routing formats is much easier. The NewtApp framework does it
for you. All you have to do is add your formats to the
frame in the application base view (that is based
proto). For more information, see
"Using the Required NewtApp Install and Remove Scripts"
beginning on page 4-21.