home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!nwnexus!phaedrus
- From: phaedrus@halcyon.com (Mark Phaedrus)
- Subject: Re: How does my app know that its document was double clicked?
- Message-ID: <1993Jan1.013518.2550@nwnexus.WA.COM>
- Sender: sso@nwnexus.WA.COM (System Security Officer)
- Organization: The 23:00 News and Mail Service
- References: <C04pu0.I5B@netnews.jhuapl.edu> <1992Dec31.154633.25705@alw.nih.gov> <1992Dec31.205747.16147@netcom.com>
- Date: Fri, 1 Jan 1993 01:35:18 GMT
- Lines: 29
-
- In article <1992Dec31.205747.16147@netcom.com> bskendig@netcom.com (Brian Kendig) writes:
- >Now I've got a question, too. How do you cope with double-clicking
- >files that belong to an _open_ application? Does this require the use
- >of AppleEvents? Right now, when I dragdrop a file onto my app, it
- >launches and opens the file, but when I dragdrop another file onto my
- >app, the Finder says "Some files could not be opened. Try opening
- >them from within the application."
-
- Well, if you support AppleEvents then you'll get the "odoc" event. If
- not, then the system software has to get creative. :) It sends you the
- appropriate events as if the user chose "Open..." or "Open" from the File
- menu. When your application calls the Standard File package to let the user
- choose what file to open, Standard File doesn't display the Open dialog;
- instead it just returns the data for the document the user double-clicked.
- If you don't have an "Open" or "Open..." command on the File menu, the
- Finder displays the "Some files could not be opened." dialog. You can get
- around this by putting two 'mstr' resources in your application; 'mstr' 102
- should hold the name of the menu that has your application's open-file command,
- and 'mstr' 103 should have the name of the open-file command itself.
- On a related note, if the user tries to shut down the Mac while your
- application is open, and you don't support Apple events, the System will use
- the "Quit" command on your application's File menu; you can tell it to use a
- different command name instead by putting the menu name to use in 'mstr' 100
- and the menu item to use in 'mstr' 101.
- --
- \o\ Internet: phaedrus@halcyon.com (Seattle, WA Public Access Unix) \o\
- \o\ "How'd you like to move a few steps down the food chain, pal?" \o\
- \o\ If you enjoy fantasy/SF stories with transformation themes, email me \o\
- \o\ for a copy of the Transformation Stories List. \o\
-