Debugging Functions

DV


DV(view)


The DV function takes a view as a parameter and prints information about that view, along with all its children, in a compact one-line-per-view format. You also get a quick flash of the view on the Newton--making it more easily identifiable.

Consider as an example a protoFloatNGo named "myFloatNGo" containing a protoStaticText named "myStaticText". Executing:

floater:= Debug("myFloatNGo");
DV(floater);
produces the following output:

myFloatNGo    #440D31D [ 38, 54,202,146] 241 vVisible vFloating vClickable
|1451352      #4417E05 [188,132,201,145] 203 vVisible vReadOnly vClickable
|myStaticText #4417E1D [ 78, 86,174,110]  3 vVisible vReadOnly
The whole protoFloatNGo flashes momentarily (see FIGURE 8.9) and then the output appears in the Inspector. The vertical bar (|) at the left of each line shows you the nesting level. Notice that you also see the viewBounds (in screen coordinates), along with a viewFlags summary.

FIGURE 8.9 : DV causes the protoFloatNGo view to flash.


Notice that the close box prints without a name (a number appears instead). To get the name to appear, download "DebugHashToName.pkg" (see "The Debug Slot in ROM Protos" on page 198).

Using the same example, executing:

DV(Debug("myStaticText"));
produces the following output:

myStaticText #4417EF5 [78, 86,174,110] 3 vVisible vReadOnly
In addition to the output, the static text also gives the comforting flash (see FIGURE 8.10).

FIGURE 8.10 : DV causes the protoStaticText view to flash.


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

Last modified: 1 DEC 1996