Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!well!smoke From: smoke@well.sf.ca.us (Nicholas Jackiw) Newsgroups: comp.sys.mac.programmer Subject: Re: Standard File help needed Message-ID: <21139@well.sf.ca.us> Date: 11 Oct 90 19:18:30 GMT References: <21010@well.sf.ca.us> <1990Oct10.180515.9025@efi.com> Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 43 In article <1990Oct10.180515.9025@efi.com> tim@efi.com (Tim Maroney) writes: >In article <21010@well.sf.ca.us> smoke@well.sf.ca.us (Nicholas Jackiw) writes: >>Unfortunately, I can't seem to find a reliable method >>for determining when the [SFGetFile] directory has changed. Things >>that I've tried: >> >>o Monitoring CurDirStore >> >>This changes erratically during directory browsing, but not >>reliably. > >Not according to my experience and to Tech Note #80, which explicitly >states that CurDirStore "contains the dirID of the directory that SF >is displaying" and that "This information can be particularly useful >at hook time". CurDirStore tracks directory changes during Standard >File. > >>o Monitoring SFSaveDisk >> >Again, this contradicts both my experience and Tech Note #80. Thanks, Tim--you're right, of course. (Finding TN#80 a few days back put me on to the real problem.) The reason my hook was detecting changes in these values "erratically" was that update events were pending. In that the Toolbox Event manager was continually re-posting these updates instead of sending nullevents, the first event that my hook saw after a directory change was the next user-caused event, which could be a file select, a button click, or yet another directory change. Processing pending updates before invoking SFGetFile fixed the problem. Now, however, I've had to switch to SFPGetFile, so that I actually see events (instead of dialogHook pseudo-events), because screen savers, etc., may post updates even after GetFile is invoked. -- --- * --- Nicholas Jackiw Smoke@well.sf.ca.us | Jackiw@cs.swarthmore.edu Key Curriculum Press, Inc. Applelink: D3970 | (415) 548-2304 --- * ---