[comp.sys.next] DSPPrintf

dwatola@nextasy2 (David Watola) (05/28/91)

here is a problem that has kept me going for the last couple of days:

in working with a few non-nextstep applications that produce postscript, i have
found it desirable to open a connection to the windowserver using
DPSCreateContext() and writing using DPSPrintf().  This avoid the overhead
of .nib files and an Application object.  Usually, it works very well for me.

while tacking this feature onto gnuplot (yes, i know this has already been
done...  but mine has draggable windows) i ran into a nasty little problem.
sometimes...  and not reliably reproducible (about 1 in ten times) the
simple gnuplot postscript being sent to the server would end up being mangled.
error messages would be send to my error handler.  now, the gnuplot code is
essentially a series of 'lineto' commands, nothing more.  a frequent error
is 'no currentpoint' after successfully plotting a 50 or so lines.

i didn't see any obvious errors in the postscript, and it worked well MOST of
the time for the same data.  so i tried using gdb and the 'showps' command.
works great every time.  it is almost as if i am sending data to the server too
fast for it to keep up.  but that is silly, since it is all mind-bogglingly
slow ascii, right?  liberally sprinkling DPSFlushContext(theContext)'s 
did not help.  tacking on DPSWaitContext(theContext) after flushing it was
disastrous--the application just wedged.

so, the question is:  has anyone else experienced similar problems?  i can
supply my code to anyone who is willing to investigate.  for now, i am giving
up since the application works well enough for my purposes.


--

dwatola @ nextasy2.eecs.wsu.edu
please, no nextmail.  ascii only.