Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!petunia!news From: araftis@polyslo.CalPoly.EDU (Alex Raftis) Newsgroups: comp.sys.next Subject: Window Caching Question Message-ID: <28010ab1.946@petunia.CalPoly.EDU> Date: 9 Apr 91 00:28:33 GMT Reply-To: araftis@polyslo.CalPoly.EDU (Alex Raftis) Organization: Cal Poly State Univ,CSC Dept,San Luis Obispo,CA 93407 Lines: 74 I'm trying to make a program to convert postscript pictures to pbm pictures. I've been able to convet postscripts to bitmaps before, and I wrote a program to convert NeXT images into pnm format pictures, bit I can't seem to get the program to work properly. It falls apart when I try to create an offscreen cache to image the postscript data into. Below is the code I'm using. Basically, it never reaches the line that prints 3. Is there something special I need to do first before I open up the cache if I'm not within the context of an NXApp? Being outside of this context is the only difference between the code below and some code I use in an application. Any help would be appreciated. Alex --- code below --- #include #include #include #include #include #include void main(void) { char *n; float w = 100.0; float h = 100.0; int rx; int ry; id cache; NXRect cacher; fprintf(stderr, "1\n"); cacher.origin.x = cacher.origin.y = 0.0; cacher.size.width = w; cacher.size.height = h; fprintf(stderr, "2\n"); cache = [Window newContent: &cacher style: NX_PLAINSTYLE backing: NX_RETAINED buttonMask: 0 defer: NO]; fprintf(stderr, "3\n"); [[cache contentView] lockFocus]; PSsetgray(1); PSnewpath(); PSmoveto(0.0, 0.0); PSlineto( w, 0.0); PSlineto( w, h); PSlineto(0.0, h); PSlineto(0.0, 0.0); PSlineto( w, h); PSmoveto(0.0, h); PSlineto( w, 0.0); PSclosepath(); PSstroke(); [[cache contentView] unlockFocus]; [cache free]; } --- sig follows --- -- -------------------------------------------------- Internet: alex@cosmos.ACS.CalPoly.EDU or araftis@data.ACS.CalPoly.EDU for NeXTmail