#!/usr/NeWS/bin/psh % % (c) 1987 Sun Microsystems, Inc. % % Steve Drach, with thanks to Owen Densmore % /MySize 12 def /MyFont /Helvetica findfont def /Foreground 0 def /Background 1 def /Draw { Background setgray clippath fill Foreground setgray MyFont MySize scalefont setfont (Hello World!\n) 2 dict begin dup true charpath flattenpath pathbbox 3 -1 roll sub win /ClientHeight get 2 copy lt { exch sub 2 div /y exch def } { pop pop /y 0 def } ifelse exch sub win /ClientWidth get 2 copy lt { exch sub 2 div /x exch def } { pop pop /x 0 def } ifelse x y moveto end show } def /ChangeSize { /MySize currentkey cvi store /paintclient win send } def /ChangeFont { /MyFont currentkey findfont store /paintclient win send } def /SetColor { /Foreground exch store /Background exch store /paintclient win send } def /PickFont [ (Times-Roman) (Courier) (Helvetica) ] [ {ChangeFont} ] /new DefaultMenu send def /PickSize [ (12) (24) (36) ] [ {ChangeSize} ] /new DefaultMenu send def /PickColor [ (Black on White) { 1 0 SetColor } (White on Black) { 0 1 SetColor } ] /new DefaultMenu send def /win framebuffer /new DefaultWindow send def /reshapefromuser win send { /PaintClient {Draw} def /FrameLabel (Hello World!) def /IconImage /hello_world def /ClientMenu [ (Font =>) PickFont (Size =>) PickSize (Color =>) PickColor (Zap) { /destroy win send } ] /new DefaultMenu send def } win send /map win send