\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\f0\b\i0\ul0\fs36 "x" View
\f1\b0\fs24 \
This is a quick demo to get you started with using the View class. While there are many fun things you can do with a view (rotate, scale, translate), I have not attempted to show them here. For a more complete example see VisibleView by Randy Nelson, or hack this program up to meet your educational needs.\
\f0\fs36 Use:\
\f1\fs24 \
You can start this program from either the shell, or Workspace Manager. However, because of the copious amount of printfs, I would
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800 strongly that you run it from a Terminal window.\
\fc0 \
When started, you will see the drawing window. If you wish to manipulate the drawing, use the control panel, which you can access from the Windows menu. The use of the three controls should be obvious.\
\f0\fs36 Duties:\
\f1\fs24 \
A view can be thought of as a rectangular portion of your window that you may draw in. You do not actively draw into this view, but rather your view is told when it needs to draw. This takes place, by another object, or perhaps the window server, calling
\f2 [yourView display].
\f1 This performs a number of duties, including saving graphic states, and telling subviews to draw themselves.\
\f0\fs36 Words of Advice:\
\f1\fs24 \
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc0 Always call display, never call drawSelf::\
There is more than one way to draw from within drawSelf::. This example uses a psw file, to simplify matters. You could instead use single operator C functions like PSsetlinewidth.\
You can use the arguments to drawSelf to optimize drawing. This is especially true if your View appears within a ScrollView, or will otherwise be clipped.\
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\fc0 To reduce the amount of PostScript sent to the server, you can define functions which are downloaded once. (perhaps in a more advanced example)\
This program is part of a combined effort to produce examples of how to program using the NeXT Appkit. If you would like more information about this effort, please contact me by one of the methods below.