[comp.windows.news] What is NEWSworthy?

mdr@reed.UUCP (Mike Rutenberg) (05/08/87)

I would love to answer these questions myself, but lacking the documentation
(for now?) I will ask you who know a bit more.

Is NEWS a superset of Postscript?  If I have a reasonable program in
Postscript that drew a pretty picture, could I feed it to NEWS and have
it draw a pretty picture?

How does NEWS handle events and interactive stuff?  What is done to
support me in building spiffy stuff in a jiffy?  Does it have a model
of interaction as with, for example, Smalltalk-80's Model-View-Controller.

Please tell me about what makes NEWS *special* - I'm favorably
predisposed to it for some reason and I'd like to know more.

Mike
-- 
	Reed College -- Portland, Oregon -- 503/774-9192

putnam@thuban.steinmetz (putnam) (05/10/87)

In article <6261@reed.UUCP> mdr@reed.UUCP (Mike Rutenberg) writes:

>Is NEWS a superset of Postscript?  If I have a reasonable program in
>Postscript that drew a pretty picture, could I feed it to NEWS and have
>it draw a pretty picture?

NeWS is a superset of PostScript.  The major additions are events,
processes, and canvasses.  Events can deal with stuff like
"MouseLeftButton just went down."  or "Its four o'clock.".  Processes
are, well, processes - and the primitives to handle them look rather
unixy (fork, wait, kill...).  Canvasses are just drawing surfaces -
like X windows.  There are some PostScript primitives that are not yet
implemented, or that are buggy, but if you want to do anything in NeWS
get a PostScript manual first.

Simple pictures draw well in NeWS, more complicated stuff may or may
not.  Of course, you need some setup to make it possible to draw
anything - making a window and grabbing its ClientCanvas is the
usual way to do it.  

>How does NEWS handle events and interactive stuff?  ...

You fork off a process that waits for, and handles events.  Very
simple (but there are a few snags hiding off in the corners).  The
following fragment (or something very like it - i dont have access to
NeWS right now so this is undebugged) waits for a mouse click and
paints the ClientCanvas alternately black and white.  This example is
very simple, contains no real alternatives and will loop forever.  It
assumes there is an entry in the current dictionary named Color.
It could be run in a window (hence my use of ClientCanvas - which
is an entry in a window dictionary).  

{
   createevent dup begin            % make an event (looks like a dict)
      /Name /RightMouseButton def   % specify what it is interested in
      /Action /DownTransition def
   end expressinterest 
   {
     awaitevent pop                 % wait for an event, pop it  
                                    % (we could examine its innards.)
     ClientCanvas setcanvas         % set current drawing surface
     clippath Color setgray fill    % paint it
     /Color 1 Color sub def 	    % flip color.
   } loop   
} fork waitprocess pop 

>                                                    ...What is done to
>support me in building spiffy stuff in a jiffy?  Does it have a model
>of interaction as with, for example, Smalltalk-80's Model-View-Controller.

Not much is currently available as tools for NeWS.  Im glad that Sun
is releasing it now so people can start to experiment with it and start
developing tools.  One of the difficulties is that its kind of tough
to see just what sorts of tools are needed until we get more experience
with it.  What is currently available is very low level, and it will
be very interesting to see what can be built from it.  It will also
be interesting to see how the design of the primitives influence the
higher level tools that will develop.

>Please tell me about what makes NEWS *special* - I'm favorably
>predisposed to it for some reason and I'd like to know more.

Its special because it is an integrated, interactive, graphics programming
system.  The integration is quite good and though there are a few wrinkles
left, it seems to all fit together quite well.

>Mike
>-- 
>	Reed College -- Portland, Oregon -- 503/774-9192
Well, shall we go?  -- jefu (jeff putnam)
Yes, lets go.       -- UUCP: steinmetz!putnam
(They do not move.) -- ARPA: putnam@ge-crd.com