/setup { % - => - (establish coordinate system) clippath pathbbox % cliche scale % scale to window size pop pop % discard x and y .5 .5 translate % translate origin 0 0 moveto % move to center 0.01 setlinewidth % set line thickness 2 setlinejoin % set endcap style /grayval .65 def % initialize gray value var grayval setgray % set gray value } def /triangle { % - => path (create a triangular path) newpath % clear path .15 0 moveto -.0625 .5 lineto .0625 -.5 lineto gsave % save path stroke % stroke it grestore % restore path } def /makewin { % - => - (builds a test window) /win framebuffer /new DefaultWindow send def % cliche { /PaintClient { % damage causes % /PaintClient to be called setup 1 1 12 { % repeat 12 times triangle % draw triangle /grayval grayval .05 sub def % decrease gray grayval setgray % set gray value fill % fill triangle 30 rotate % rotate through 30*12 } for } def /FrameLabel ( Workspace ) def % label the window /PaintIcon { % define the icon image erasepage % clear the canvas PaintClient % call /PaintClient .9 strokecanvas % stroke canvas border } def } win send /reshapefromuser win send % size it /map win send % make it visible } def makewin % run the program