Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!cit-vax!tybalt.caltech.edu!palmer From: palmer@tybalt.caltech.edu (David Palmer) Newsgroups: comp.sys.mac.programmer Subject: gGopher question Message-ID: <11945@cit-vax.Caltech.Edu> Date: 18 Sep 89 17:31:54 GMT Sender: news@cit-vax.Caltech.Edu Reply-To: palmer@tybalt.caltech.edu.UUCP (David Palmer) Organization: California Institute of Technology Lines: 41 I just upgraded to Think C 4.0 (WOW!) and am diving in to object-oriented programming. I am writing a special purpose drawing program in Think C 4.0, and I need help. (The drawing portion of the program is a major part of a 3-D simulator.) 1) Has anyone developed a class structure good for drawing that they could place in the public domain? 2) Should the Ancestor class of the drawn objects be CBureaucrat? (Drawn objects respond to commands, keys, and mice, so I guess so.) 3) The documentation for CBureaucrat says that a Bureaucrat should handle Keys and Commands, which are automagically passed to it when it is the gGopher, but it doesn't say what happens to Mouse clicks. Are they also sent to the gGopher? 4) What should the flow of control be? Should the selected drawing object become the gGopher (or the Pane if nothing is selected), or should the Pane (or the Document?) handle mouse clicks and commands, passing them on to the currently selected object? 5) Can an Object be written-to and read-from a file in the standard manner? (with the Mac equivalent of fwrite(*Object, sizeof(object), 1, stream) where *Object is the first argument and singly indirects the handle of Object to get a pointer.) How are objects within objects best handled? (By which I mean references to objects. For instance, each object may have a list of the objects touching it, etc.) I am currently planning to keep all objects in lists, and, at save time, replace the contained object's handle with an index into the list. It is ugly, but I can't think of any other way to do it. Thanks in advance. David Palmer palmer@tybalt.caltech.edu ...rutgers!cit-vax!tybalt.caltech.edu!palmer "Direct quotes don't have to be exact, or even accurate. Truth is as irrelevant to a newspaper as it is to a court of law" - Judge Alarcon, 9th circuit court of appeals (paraphrased)