Path: utzoo!mnetor!uunet!husc6!yale!cmcl2!nrl-cmf!ames!lll-lcc!pyramid!voder!wlbr!mh From: mh@wlbr.EATON.COM (Mike Hoegeman) Newsgroups: comp.windows.misc Subject: Re: Does anyone really understand windows? Message-ID: <1184@wlbr.EATON.COM> Date: 18 Feb 88 01:59:59 GMT References: <1457@sugar.UUCP> Reply-To: mh@wlbr.UUCP (0000-Mike Hoegeman) Organization: Eaton IMS, Westlake Village, CA Lines: 44 In article bader+@andrew.cmu.edu (Miles Bader) writes: > >Here's a program for the "Andrew Toolkit" that displays helloworld in a >window... Note that it (like the Xtk version in David Rosenthal's paper) >isn't a good example if you want to do more than use pre-existing views & >dataobjects or combinations thereof (but see the second version later in this >message). Here's A hello world window in NeWSpeak... this is just off the top of my head but it's close enough so you can get the idea of how the object oriented stuff in NeWS works. It prints Hello world in the bottom left hand corner of the window. % send a new method to the DefaultWindow class object... % it'll return an instance of the DefaultWindow window class % which we'll call HelloWorldWindow /HelloWorldWindow framebuffer /new DefaultWindow send def % Now send the window the title it should have and the routine to % use to repaint when it gets damaged, resized, etc... { /PaintClient { painthelloworld } def /FrameLabel (Hello World) def } HelloWorldWindow send % the paint hello world proc... /painthelloworld { gsave 4 4 moveto 1 1 1 sethsbcolor /Times-Bold findfont 14 scalefont setfont (Hello World) show grestore } def % have the user drag the window size ... /reshapefromuser HelloWorldWindow send % and display the window... /map HelloworldWindow send a whopping 13 lines of postscript!