[comp.windows.news] Using PSH to produce output in a window

kds545@leah.Albany.Edu (Kevin Samborn) (03/03/89)

I am interested in using psh with psterm to produce postscript output
interactively.  The only problem is that the output appears in 
framebuffer, and sometimes behind the other windows, is illegible, etc.

What I want to do is when I call psh, I would like there to also be a 
concurrent window I would call the 'graphics window', where the psh
output would appear.  This way, I could run my psterm, my editor, and 
psh all in windows, and also have my output in a window.  


The reason I need to do this is for a teaching mechanism.

I hope someone out there knows this.  Thanks.


-- 
|  Kevin Samborn                   |       kds545@leah.albany.edu
|  529 Washington Ave.             |       
|  Albany, NY  12206               |       (voice)   518-465-9526

swagman@SUN.COM (Patrick J. McEvoy (Sun Entry Systems ISV Liaison)) (03/03/89)

>	I am interested in using psh with psterm to produce postscript
>	output interactively.  The only problem is that the output
>	appears in framebuffer...I would like there to also be a
>	concurrent window I would call the 'graphics window', where the
>	psh output would appear.

I usually start off my psh sessions with:

	/mywin framebuffer /new DefaultWindow send def
	/reshapefromuser mywin send
	/map mywin send
	/mycanvas /GetCanvas mywin send def
	mycanvas setcanvas

I suppose you could make the canvas retained as well.

hugh@hoptoad.uucp (Hugh Daniel) (03/03/89)

  If you are allready getting PostScript(tm) to the framebuffer
you can open your own window with:

	/win framebuffer /new DefaultWindow send def
	/reshapefromuser win send
	/map win send
	win /ClientCanvas get setcanvas

  The comments for the four lines above might be:
	% Create a new instance of the class DefaultWindow

	% Send a message to the instance telling it to ask
	%   the user for where/how-big the window is to be

	% Display the instance on the screen

	% Get the canvas out of the instance and set it to
	%   be the default canvas

  Oh, you might do the middle two lines as:
	{reshapefromuser map} win send
though there might be some gripes about doing it that way.

  The rest of your your code will now display in the window.


                ||ugh Daniel
hugh@toad.com                   Grasshopper  Group,  +1 415/668-5998
hugh@xanadu.com			1996 Hayes St. San Francisco CA94117

des%orenda@amara.UUCP (Dave Steinhoff) (03/04/89)

I'm not exactly sure what would suit you best, but it is straight-
forward to run psh and open a window into which subsequent graphics
operations are directed.  For example,

% psh
executive
/win framebuffer /new DefaultWindow send def
/reshapefromuser win send
{/FrameLabel (* PSH Output Window *) def
 /PaintClient {1 fillcanvas} def
 /IconImage /door def
} win send
/map win send

{ClientCanvas} win send setcanvas

.5 fillcanvas

...would create a window with a white background and then fill the
background with a .5 grayscale pattern (on a b/w box).  All but the
last line could be saved in a file to shorten the preamble:

% psh
executive
(.../psh-win) run
.5 fillcanvas

...to produce the same effect.  I apologize if you were looking for
a different sort of solution.  Let me know how it goes.

Dave.

Dave Steinhoff			(313)973-1300
...uunet!amara!des		Applied Dynamics International
des@amara.UUCP			3800 Stone School Rd, Ann Arbor, Mi 48108