|
|
Sample Programs from NeXSTEP 3.3
{\rtf0\ansi{\fonttbl\f1\fswiss Helvetica;\f2\fmodern Courier;\f0\fmodern Ohlfs;}
\paperw9560
\paperh9860
\margl120
\margr120
{\colortbl;\red0\green0\blue0;}
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f1\b\i0\ul0\fs36\fc0\cf0 Yap
\b0\fs24 \
\
Yap,
\i Yet Another Previewer
\i0 , is a simple text-editor which provides the ability to interactively execute the documents as PostScript programs. Yap demonstrates:\
\
\fi-140\li360 � Execution of random PostScript code in a separate window server context\
� Caching drawing for fast scrolling purposes\
� Multi-window documents loaded from nib files containing ScrollViews with subclass of Text\
� Pasting PostScript as text\
� A simple Find panel\
\fi0\li0\fc1\cf1 \
\f2 YapOutput.m
\f1 and
\f2 YapWrap.psw
\f1 contain the code which creates a separate context that is focused on a window belonging to the application's main context and send PostScript down to this second context for execution. This second context is kept around as long as no errors occur; however, in case of errors a new one is created.\
\
\f2 YapDocument.m
\f1 shows the YapDocument class which manages the documents. The source code for YapDocument demonstrates, among other things, how to read a
\f2 .nib
\f1 file over and over again to create multiple document windows.\
\
If your application needs to import EPS files, then its probably best to stick to the
\f2 NXEPSImageRep
\f1 class (or
\f2 NXImage
\f1 , which uses
\f2 NXEPSImageRep
\f1 to manage its EPS representations) rather than using the code in
\f2 YapOutput.m
\f1 .
\f2 NXEPSImageRep
\f1 uses a separate context to execute EPS files in a manner similar to Yap.\
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.