home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20499 < prev    next >
Encoding:
Text File  |  1992-12-31  |  2.4 KB  |  41 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!nwnexus!phaedrus
  3. From: phaedrus@halcyon.com (Mark Phaedrus)
  4. Subject: Re: How does my app know that its document was double clicked?
  5. Message-ID: <1993Jan1.013518.2550@nwnexus.WA.COM>
  6. Sender: sso@nwnexus.WA.COM (System Security Officer)
  7. Organization: The 23:00 News and Mail Service
  8. References: <C04pu0.I5B@netnews.jhuapl.edu> <1992Dec31.154633.25705@alw.nih.gov> <1992Dec31.205747.16147@netcom.com>
  9. Date: Fri, 1 Jan 1993 01:35:18 GMT
  10. Lines: 29
  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.      Well, if you support AppleEvents then you'll get the "odoc" event.  If
  21. not, then the system software has to get creative. :)  It sends you the 
  22. appropriate events as if the user chose "Open..." or "Open" from the File
  23. menu.  When your application calls the Standard File package to let the user
  24. choose what file to open, Standard File doesn't display the Open dialog; 
  25. instead it just returns the data for the document the user double-clicked.
  26.      If you don't have an "Open" or "Open..." command on the File menu, the
  27. Finder displays the "Some files could not be opened." dialog.  You can get
  28. around this by putting two 'mstr' resources in your application; 'mstr' 102
  29. should hold the name of the menu that has your application's open-file command,
  30. and 'mstr' 103 should have the name of the open-file command itself.
  31.      On a related note, if the user tries to shut down the Mac while your
  32. application is open, and you don't support Apple events, the System will use
  33. the "Quit" command on your application's File menu; you can tell it to use a
  34. different command name instead by putting the menu name to use in 'mstr' 100
  35. and the menu item to use in 'mstr' 101.
  36. -- 
  37. \o\ Internet: phaedrus@halcyon.com  (Seattle, WA Public Access Unix)     \o\
  38.  \o\ "How'd you like to move a few steps down the food chain, pal?"       \o\
  39.   \o\ If you enjoy fantasy/SF stories with transformation themes, email me \o\
  40.    \o\ for a copy of the Transformation Stories List.                       \o\
  41.