Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!cs.utexas.edu!uunet!dtgcube!ed From: ed@uunet!dtgcube (Edward Jung) Newsgroups: comp.sys.next Subject: Re: Multiple instantiation of windows laid out with IB Message-ID: <1989Oct22.103111.26875@uunet!dtgcube> Date: 22 Oct 89 10:31:11 GMT References: <130030@gore.com> Organization: The Deep Thought Group, L.P. Lines: 40 In-Reply-To: jacob@gore.com's message of 21 Oct 89 21:36:33 GMT >Is there a way to use the Interface Builder to set up a window, and then >create an arbitrary number of copies of this window from the program, at >run-time? Yes, you can do that with Interface Builder. Instructions on how to do it are in the Interface Builder chapter dealing with a multi-window editor (Project 4, Chapter 8, pp.47 in the on-line manual /NextLibrary/Documentation/NeXT/SysRefMan/08_IntfBuilder.wn). The instructions are relatively straight-forward. There are also other ways: You might be tempted to use the message 'copy' to make a copy of the objects, but avoid this. 'copy' makes an exact copy, including all *references* to other objects (rather than copying those objects), which is ALMOST CERTAINLY NOT what you want. Instead, use typed streams to copy objects: #import id copyObject(id baseObject) { id returnValue; int length; char * buffer = NXWriteRootObjectToBuffer(baseObject, &length); returnValue = NXReadObjectFromBuffer(buffer, length); /* error checking here */ NXFreeObjectBuffer(buffer, length); return returnValue; } This writes out a graph of the object and then reads it back in, all in memory. Hope this helps. -- ================================================================= Edward Jung The Deep Thought Group, L.P. BIX: ejung 3400 Swede Hill Road UUCP: uunet!dtgcube!ed Clinton, WA. 98236