Path: utzoo!attcan!uunet!mcsun!ukc!slxsys!bae-st!mike From: mike@ste.dyn.bae.co.uk (Mike Heley) Newsgroups: comp.windows.open-look Subject: Re: NeWS graphics in X11 program Message-ID: <1991Jan23.103329.11656@ste.dyn.bae.co.uk> Date: 23 Jan 91 10:33:29 GMT Reply-To: mike@ste.dyn.bae.co.uk (Mike Heley) Organization: British Aerospace (Dynamics), Stevenage Lines: 49 In response to Steve Cole's request for advice on using NeWS graphics from an X11 program - I am in the process of changing the canvas graphics output portion of an XView program from xlib to the NeWS extended postscript. Since I have most of it working now, I can tell you where I started looking and a few of the problems I found. In my OpenWindows 2.0 there was a document ($OPENWINHOME/share/xvps.ps) which describes the PSCANVAS package. I found the package itself pretty limited, compared to the normal XView canvas, in particular, there seemed to be no support for split views or event procs. My application also couldn't cope with the fact that the repaint/resize procs got called with a changing xview object handle. However, there are a couple of cps macros which allow NeWS graphics on any X11 window. I used these in combination with the normal XView canvas object to get full canvas functionality + NeWS on the paintwindows. I couldn't find the cps source file for the macros, but working back from the tokenised macros, I found they do something like #define CANVAS_TOKEN_TAG 51 cdef ps_token_from_xid(xid, canvastoken) => CANVAS_TOKEN_TAG (canvastoken) xid /XLookupID XResource send dup type /canvastype ne {pop -1} {currentfile countfileinputtoken dup 3 -2 roll setfileinputtoken} ifelse CANVAS_TOKEN_TAG tagprint typedprint cdef ps_setcanvas(token canvastoken) canvastoken setcanvas which seems to work okay. One thing I would like to know. How do you go about debugging applications which use cps macros, and how on earth to you handle error conditions which occur on the server side? -- Mike Heley mike@ste.dyn.bae.co.uk British Aerospace Dynamics +44 438 752432 Stevenage, UK "Schizophrenic? I'm bleedin' Quadrophenic!" - The Who, 1973. --