Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!apple!well!smoke@well.sf.ca.us From: smoke@well.sf.ca.us (Nicholas Jackiw) Newsgroups: comp.sys.mac.programmer Subject: Standard File help needed Message-ID: <21010@well.sf.ca.us> Date: 5 Oct 90 22:54:07 GMT Sender: smoke@well.sf.ca.us Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 49 Can anyone give me a hand with some Standard File magic? I'd like to implement an Open All button in the SFGetFile dialog. As usual, this should be dimmed if the currently viewed folder does not contain any files of the appropriate fType. The obvious way to go about this is to have the dialog hook disable the button everytime a new directory appears, and then have the file-filter re-enable it (if the filter is called, obviously there's a file of fType sitting in the directory). Unfortunately, I can't seem to find a reliable method for determining when the directory has changed. Things that I've tried: o Monitoring CurDirStore This changes erratically during directory browsing, but not reliably. o Monitoring SFSaveDisk This doesn't seem to change at all (except perhaps once at the very end of the dialog). o Monitoring theReply.vRefNum This only gets instantiated at the end of the dialog, and is zero before then. o Watching which items the user hits As of IM-IV, the hook will see changes in directory when the user clicks or opens a folder as item#103, and can detect clicks on the Drive button as item#6. However, one can also navigate between directories with cmd-up and cmd-down, and with the pop-up menu of "open" directories. While you can tell when one of these events occur, you can't (based on the item number) tell whether it caused a change in the active directory (and therefore, reason to dim the Open All control). --- I'm a bit befuddled at what should be a straightforward task. In that 7.0 revises Standard File somewhat, I'd like to find a scheme with good chances of surviving the future. Any hints would be appreciated.