Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ut-ngp.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!seismo!ut-sally!ut-ngp!awd From: awd@ut-ngp.UUCP (Andrew W. Donoho) Newsgroups: net.micro.mac Subject: Re: Custom windows and resources. Message-ID: <2618@ut-ngp.UUCP> Date: Mon, 18-Nov-85 02:16:37 EST Article-I.D.: ut-ngp.2618 Posted: Mon Nov 18 02:16:37 1985 Date-Received: Tue, 19-Nov-85 05:59:55 EST References: <508@harvard.ARPA> Distribution: net Organization: UTexas Computation Center, Austin, Texas Lines: 31 Answers to your two questions: How can I use a custom windowProc from a desk accessory? Yes, Desk Accessories can have their own private resources, as described in the Resource Manager section of Inside Macintosh. However, the IDs that these "owned" resource can use restrict you so that you can not have a conventional "WDEF" resource for your window defProc. The best thing to do is to create the window using NewWindow or GetNewWindow and then replace the windowDefProc field with a handle your special window definition (this can be a resource handle, or just a normal handle: if it is a resource handle, LoadResource will be called each time it is dereferenced by the ROM). Where can I store special data for each window for a windowProc? There is a field in each window called dataHandle. This is intended to hold a handle (or any other 4 bytes) for the use of the windowDefProc. This means that the defProc should make a handle of the desired size and store it's globals there. By the way, LoadResource will be a no-op if the handle passed to it is not a resource or invalid. This is quite useful. Resource Manager routines, as a rule, are more tolerant of bad input than Memory Manager routines or even the other Toolbox routines. But don't make the mistake of passing NIL for the name of a resource in SetResInfo or AddResource. That is a common mistake (MDS Edit and the original RMover have or had this error). Darin Adler