Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!fernwood!apple!stevec From: stevec@Apple.COM (Steve Christensen) Newsgroups: comp.sys.mac.programmer Subject: Re: Dialog problems in DA Message-ID: <47726@apple.Apple.COM> Date: 3 Jan 91 23:57:04 GMT References: <4927@tellab5.tellabs.com> <47695@apple.Apple.COM> <4932@tellab5.tellabs.com> Organization: Apple Computer Inc., Cupertino, CA Lines: 29 kenk@tellabs.com (Ken Konecki) writes: >stevec@Apple.COM (Steve Christensen) writes: >>I guess my first question would be "why aren't you just using a dialog >>template (DLOG) as well as the item list (DITL)?". You can then just >>call GetNewDialog() which will return a non-nil pointer if everything >>is setup OK. I don't know exactly why your way is failing, but this >>seems a whole lot simpler... > >I was wondering when someone was going to ask me this. I was having >trouble with Font/DA mover renumbering the DITL resource. Consequently, >when I would call GetNewDialog(), the DITL resource number within the DLOG >template would be wrong. Is it possible to make the DITL resource owned by >the DLOG resource and have Font/DA mover put it in the system file >correctly? Use an owned resource ID for both the DLOG and DITL. For example, if your DA has an ID of 20, you should use an ID of (-15744 + offset), where, I believe, offset is in the range of something like 0 to 15, and -15744 is the base resource ID. Then Font/DA Mover should renumber everything correctly, and all your DA has to do is dynamically calculate the base resource ID from its new ID and add on the appropriate offset... steve -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Steve Christensen | Apple Computer, Inc. | Disclaimer: | 20525 Mariani Ave, MS-81CS | the above may be stevec@apple.com | Cupertino, CA 95014 | a lie...or not.