Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Standard File and Desk Accessories Message-ID: <7578@hoptoad.uucp> Date: 7 Jun 89 18:46:35 GMT References: <50967@tut.cis.ohio-state.edu> <7547@hoptoad.uucp> <4972@umd5.umd.edu> <51276@tut.cis.ohio-state.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 45 In article <51276@tut.cis.ohio-state.edu> Todd A Hitt writes: >But enough of that. Here's the solution or part of it, I used (and it works) >that was sent to me by Krzysztof Kozminski: > >>Anyway, just an idea, based on what I do: >> >> long **h = NewHandle(4); >> int checkBoxValue; >> >> **h = (long) &checkBoxValue; >> AddResource(h,'pvte',0,"\p"); I don't mean to be the bad guy, but this is a horrible solution. Adding resources to someone else's resource file? Can you say massive potential for conflicts? Can you say forget about network compatibility if you write into an application file? Can you say every sense of programming elegance revolts? There are a number of other solutions that work much better. Ben Cranston pointed out that the dialog item list could have a pointer to globals appended to the end of it. I pointed out that you could use the refCon of your main DA window behind the SF dialog; I also pointed out that you could write into your DA's code space. Rich Siegel suggested using the private storage field of your DA's device control entry, which you can find by looping through the unit table as described in a Tech Note. I'm sure you got other reasonable answers as well, answers that don't require writing into other people's files without even knowing what files they are! >> RmveResource(h); /* Don't want it added to, e.g., System */ That's for sure! Not even for a second! >I've modified it a little to suit me but it works like a champ. I do feel >a little funny using the resource manager like this, but it doesn't look like >there is any particularly clean way to do this. There are much cleaner ways that that, believe me.... -- Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim "When errors are found in old research, the relevant theories are re-examined. When facts contradict theory, theory gets dumped. Is that why the NLP people are unwilling to research their facts?" -- Jerry Hollombe on sci.psychology