home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!uwm.edu!ogicse!reed!bowman
- From: bowman@reed.edu (BoBolicious)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: How does my app know that its document was double clicked?
- Message-ID: <1992Dec31.213234.17023@reed.edu>
- Date: 31 Dec 92 21:32:34 GMT
- Article-I.D.: reed.1992Dec31.213234.17023
- References: <C04pu0.I5B@netnews.jhuapl.edu> <1992Dec31.154633.25705@alw.nih.gov> <1992Dec31.205747.16147@netcom.com>
- Organization: Reed College, Portland, OR
- Lines: 22
-
- 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."
-
- Naturally, AppleEvents are the preferred way to handle this.
-
- If you app isn't AE-aware, MF/Sys7 attempts to fool your app by patching a
- bunch of traps, and passes your app a mousedown event in the File menu,
- resolves it to whicheven item in the File menu is "Open...", then patches
- SFGetFile, return an SFReply that has the double-clicked document in the
- record. If there's anything funky about how your app handles opening files,
- in particular if there are different menu items to open different kinds of
- files, this scheme will fail.
-
- cheers,
- bobo In seeking the unattainable,
- bowman@reed.edu simplicity only gets in the way.
- Eternal nothingness is fine if you happen to be dressed for it. - Woody
-