home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!sgigate!psinntp!psinntp!newstand.syr.edu!greeny
- From: greeny@top.cis.syr.edu (J. S. Greenfield)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Moving to the foreground after receiving an 'odoc' from the Finder
- Message-ID: <1992Jul22.003451.6460@newstand.syr.edu>
- Date: 22 Jul 92 04:34:51 GMT
- References: <mxmora-200792113832@css-mac1.sri.com> <1992Jul20.195334.19197@newstand.syr.edu> <1992Jul21.161251.7693@midway.uchicago.edu>
- Organization: Syracuse University, CIS Dept.
- Lines: 48
-
- In article <1992Jul21.161251.7693@midway.uchicago.edu> jcav@midway.uchicago.edu writes:
- >>
- >>What is the standard technique to insure that your application is in the
- >>foreground after receiving an 'odoc' event from the finder?
- >>
- >>I have an application (which does not recieve suspend/resume events) which
- > ^^^^^ ^^^^ ^^^ ^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^
- >This is the root of your problem. If you accept high-level events, you also
- >_must_ accept OS events (suspend/resume, etc).
-
- But this is not correct. The SIZE resource has a bit to indicate whether
- the application receives suspend/resume events. Since this application
- does not manipulate any scrap or manipulate any windows (other than modal
- dialogs), it has no need for suspend/resume events.
-
- Anyway, even if they were sent, I don't mask them out. They just would not
- produce any response from my application.
-
-
- >>brings up a custom get file after receiving an 'odoc' event. If there are
- >>some finder windows open, the get file dialog will occasionally appear
- >>*behind* the finder windows, initially. It then moves to the front, but
- >>the dialog window is left empty.
- >
- >If you want to be absolutely sure you're in front, you can call
- >_SetFrontProcess (I think that's the name) with your own process serial #.
- >However, I suspect that if you handle your suspend/resume events by the
- >book, the other problems should "factor out".
-
- Actually, several individuals pointed me to the proper technique when handling
- apple events, which is to call AEInteractWithUser. This routine checks both
- the server's and client's specification for allowed interaction in processing
- the event, and will call the notification manager, if necessary, in order to
- request that the user move the server application to the foreground.
-
- (See IM VI, 6-51 through 6-54.)
-
- In my case, this is not necessary--the call simply holds up my application
- until it moves to the foreground, as it will normally do since 'odoc' events
- from the Finder allow the server to interact (and the Finder seems to
- undertake to move the server to the foreground, itself).
-
-
- --
- J. S. Greenfield greeny@top.cis.syr.edu
- (I like to put 'greeny' here,
- but my d*mn system wants a
- *real* name!) "What's the difference between an orange?"
-