Debugging Functions

GetView


GetView(template)
GetView('viewFrontMost)
GetView('viewFrontMostApp)
GetView('viewFrontKey)


This function returns a view based on its parameter:

template
Searches all open views to find one whose template equals template.

'viewFrontMost
Returns the frontmost view with the vApplication bit set.

'viewFrontMostApp
Returns the frontmost view with the vApplication bit set, while skipping views with the vFloating bit set.

'viewFrontKey
Returns the view accepting keyboard input (the one with the caret).

The following application clarifies the distinctions between 'viewFrontMost and 'viewFrontMostApp. It consists of a protoApp containing a protoFloatNGo with two protoInputLines (see FIGURE 8.8). The viewFlags of the protoFloatNGo have been altered to vApplication, vReadOnly, and vFloating (the default is vReadOnly and vFloating).

FIGURE 8.8 : An application demonstrating the different uses of GetView().


With the application open:

GetView('viewFrontMost) returns the protoFloatNGo view.

GetView('viewFrontMostApp) returns the protoApp view.

After closing the protoFloatNGo:

GetView('viewFrontMost) returns the protoApp view.

GetView('viewFrontMostApp) returns the protoApp view.


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

Last modified: 1 DEC 1996