Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!ncar!boulder!sunybcs!bingvaxu!leah!uwmcsd1!ig!agate!ucbvax!BRILLIG.UMD.EDU!don From: don@BRILLIG.UMD.EDU (Don Hopkins) Newsgroups: comp.windows.news Subject: NeWS Beginner Questions Message-ID: <8805150638.AA14535@brillig.umd.edu> Date: 15 May 88 14:13:47 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 49 Date: 13 May 88 13:20:24 GMT From: mcvax!ukc!stl!tjcm@uunet.uu.net (Crawford Macnab) o Are class variables really different from instance variables ? Looking at litewin.ps it appears that every time a window is mapped for the first time the class variables /FrameMenu and /IconMenu are redefined. Surely if a class object contains information to be inherited by all sub-classes then this information should be initialised at class creation time. o Has anyone created a window based interface to the debug.ps package ? The difference between instance variables and class variables are that class variables are shared by all instances of a class and its subclasses, while each instance has its own local instance variables. The template for a class definition is: /NewClass SuperClass dictbegin % Instance variables dictend classbegin % Class variables and methods classend def (dictbegin/dictend can be replaced by an array of names that will be initialized to null.) The instance variables are defined between dictbegin/dictend, and every new instance will be initialized with the values defined there. The class variables and methods (there's physically no difference, methods are just variables with executable arrays as values) are defined in the class dictionary between the classbegin/classend pair. You can override a class variable, making it into an instance variable, by def'ing its new value in the instance dictionary. I tried making FrameMenu and IconMenu class variables, and it worked, except that the "Spin!" demo obnoxiously adds keys to the shared FrameMenu! A window based debugger sure would be nice! Has anybody created Items to display and edit various NeWS data types? (i.e. canvas editor, process editor, dictionary editor, etc...) -Don