home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 20662 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  2.8 KB

  1. Path: sparky!uunet!spool.mu.edu!olivea!apple!grobbins
  2. From: grobbins@Apple.COM (Grobbins)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: SFGetFile's directory after an Open Event
  5. Message-ID: <76105@apple.apple.COM>
  6. Date: 5 Jan 93 06:49:40 GMT
  7. References: <1993Jan4.190815.5881@ccu1.aukuni.ac.nz> <1993Jan4.205533.25405@kth.se>
  8. Organization: Apple Computer Inc., Cupertino, CA
  9. Lines: 49
  10.  
  11. In article <1993Jan4.205533.25405@kth.se> d88-jwa@dront.nada.kth.se (Jon Wtte) writes:
  12. >In <1993Jan4.190815.5881@ccu1.aukuni.ac.nz> russells@ccu1.aukuni.ac.nz (Russell Street) writes:
  13. >>After an application receives an 'odoc' Apple Event to open a document
  14. >>should it arrange it so the next Standard File [Open] Dialog that is
  15. >>brought up by the user is the same directory that the 'odoc' document
  16. >>came from?
  17. >
  18. >If Apple thought that would be the right thing to do, they would
  19. >have done it themselves. Doing so requires changing lo-mem globals;
  20. >that's a dangerous habit you should break out of.
  21.  
  22. Changing low-memory globals is not a particularly dangerous habit for
  23. system software, so that's not the reason the system isn't setting the
  24. Standard File directory.  I'm not certain if the Blue Meanies made a
  25. calculated decision in System 7 on setting up Standard File or not, but
  26. the way the current system leaves Standard File pointing to useless
  27. places is clearly unpleasant.
  28.  
  29. >Not to mention: if the app gets an odoc, the user most probably has
  30. >the folder open in the Finder, and going there and double-clicking
  31. >would be much easier than choosing "Open" in the File menu.
  32.  
  33. But what about when the user makes a change to the open document
  34. and then chooses Save As...?  Standard File continues to point to
  35. somewhere irrelevant (for most Apple event-aware apps, anyway.)
  36.  
  37. Back when I was doing work for DTS, I revised the Standard File Tips
  38. Tech Note and included a recommendation that apps change the Std File
  39. globals (SFSaveDisk and CurDirStore) when they received an 'odoc' from
  40. the Finder.  However, I could not build a consensus on when the app
  41. should and should not change the Std File directory (since scripting
  42. systems may also send 'odoc's) so I never released the revised version
  43. of the Tech Note.
  44.  
  45. No one objected to developers storing values in those low-memory globals.
  46. Yeah, it's best to avoid doing such things, but those are well documented
  47. globals, there is no alternative method at present, and if you isolate
  48. access to such globals in your code, any future updates will be
  49. relatively painless.
  50.  
  51. Except for those people who absolutely must control every aspect of
  52. their users' environment, my current recommendation is to leave
  53. Standard File alone.  At least this way, when the system software
  54. folks get around to making Standard File point somewhere meaningful,
  55. your code won't be interfering.
  56.  
  57. Grobbins                grobbins@apple.com
  58.  
  59. Usual disclaimers apply.
  60.