Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!purdue!decwrl!shelby!polya!ali From: ali@polya.Stanford.EDU (Ali T. Ozer) Newsgroups: comp.sys.next Subject: Re: copying Controls Message-ID: <11126@polya.Stanford.EDU> Date: 4 Aug 89 23:12:20 GMT References: <23996@labrea.Stanford.EDU> <10884@polya.Stanford.EDU> <10906@polya.Stanford.EDU> Sender: Ali T. Ozer Reply-To: aozer@NeXT.com (Ali Ozer) Organization: . Lines: 21 In article <10906@polya.Stanford.EDU> aozer@NeXT.com (Ali Ozer) writes: >Given this, it does indeed seem like Button (and various other AppKit >objects) do not respond properly to the "copy" method. I'll make a >suggestion concerning this... I did get back one valuable piece of information concerning making copies of objects: Provided the object is able to read or write itself (and all AppKit objects do), use the typedstream package to copy objects: // We want to make a copy of object obj. int length; char *buf = NXWriteRootObjectToBuffer (obj, &length); copyOne = NXReadObjectFromBuffer (buf, length); copyTwo = NXReadObjectFromBuffer (buf, length); // Make as many copies as you wish... ... // Then free the buffer NXFreeObjectBuffer (buf, length); Ali Ozer, NeXT Developer Support aozer@NeXT.com