Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!apple!usc!orion.cf.uci.edu!uci-ics!zardoz!dhw68k!thecloud From: thecloud@dhw68k.cts.com (Ken McLeod) Newsgroups: comp.sys.mac.programmer Subject: Re: cdev question: Why does GetDItem return bad value on closeDev? Message-ID: <25077@dhw68k.cts.com> Date: 22 Jul 89 09:11:19 GMT References: <783@kinetics.UUCP> Reply-To: thecloud@dhw68k.cts.com (Ken McLeod) Organization: Wolfskill & Dowling residence; Anaheim, CA (USA) Lines: 20 In article <783@kinetics.UUCP> mahboud@kinetics.com (Mahboud Zabetian) writes: > >Does anyone know what state the Control Panel is in at the time of a closeDev >call? I do a GetDItem and SetIText when I get a closeDev call, but it never >works, and sometimes it even crashes. When your cdev gets a 'closeDev' message, your appended dialog items have already been un-appended from the Control Panel's DITL, and are no longer valid. If you have text in an editText item, keep a current copy around (in your private block of storage) and update it whenever you get a keyEvtDev or a hitDev involving the editText item. That way, you won't have to read it right at closing time. I don't understand why you'd want to do a SetIText on a closeDev... you meant GetIText? -- ========== ....... ============================================= Ken McLeod :. .: UUCP: ...{spsd,zardoz,felix}!dhw68k!thecloud ========== :::.. ..::: INTERNET: thecloud@dhw68k.cts.com //// =============================================