home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20484 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  1.7 KB

  1. Path: sparky!uunet!spool.mu.edu!uwm.edu!ogicse!reed!bowman
  2. From: bowman@reed.edu (BoBolicious)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: How does my app know that its document was double clicked?
  5. Message-ID: <1992Dec31.213234.17023@reed.edu>
  6. Date: 31 Dec 92 21:32:34 GMT
  7. Article-I.D.: reed.1992Dec31.213234.17023
  8. References: <C04pu0.I5B@netnews.jhuapl.edu> <1992Dec31.154633.25705@alw.nih.gov> <1992Dec31.205747.16147@netcom.com>
  9. Organization: Reed College, Portland, OR
  10. Lines: 22
  11.  
  12. In article <1992Dec31.205747.16147@netcom.com> bskendig@netcom.com (Brian Kendig) writes:
  13. >Now I've got a question, too.  How do you cope with double-clicking
  14. >files that belong to an _open_ application?  Does this require the use
  15. >of AppleEvents?  Right now, when I dragdrop a file onto my app, it
  16. >launches and opens the file, but when I dragdrop another file onto my
  17. >app, the Finder says "Some files could not be opened.  Try opening
  18. >them from within the application."
  19.  
  20. Naturally, AppleEvents are the preferred way to handle this.
  21.  
  22. If you app isn't AE-aware, MF/Sys7 attempts to fool your app by patching a
  23. bunch of traps, and passes your app a mousedown event in the File menu, 
  24. resolves it to whicheven item in the File menu is "Open...", then patches 
  25. SFGetFile, return an SFReply that has the double-clicked document in the 
  26. record.  If there's anything funky about how your app handles opening files, 
  27. in particular if there are different menu items to open different kinds of 
  28. files, this scheme will fail.
  29.  
  30. cheers,
  31. bobo              In seeking the unattainable,
  32. bowman@reed.edu            simplicity only gets in the way.
  33. Eternal nothingness is fine if you happen to be dressed for it. - Woody
  34.