home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!mcsun!sunic!kth.se!dront.nada.kth.se!d88-jwa
- From: d88-jwa@dront.nada.kth.se (Jon W{tte)
- Subject: Re: Moving to the foreground after receiving an 'odoc' from the Finder
- In-Reply-To: jcav@quads.uchicago.edu's message of Tue, 21 Jul 1992 16:12:51 GMT
- Message-ID: <D88-JWA.92Jul21225659@dront.nada.kth.se>
- Originator: d88-jwa@dront.nada.kth.se
- Sender: usenet@kth.se (Usenet)
- Nntp-Posting-Host: dront.nada.kth.se
- Organization: Royal Institute of Technology, Stockholm, Sweden
- References: <D2150035.8p3ep6@outpost.SF-Bay.org>
- <mxmora-200792113832@css-mac1.sri.com>
- <1992Jul20.195334.19197@newstand.syr.edu>
- <1992Jul21.161251.7693@midway.uchicago.edu>
- Date: Tue, 21 Jul 1992 21:56:59 GMT
- Lines: 38
-
- .uchicago.edu> jcav@quads.uchicago.edu (JohnC) writes:
-
- This is the root of your problem. If you accept high-level events, you also
- _must_ accept OS events (suspend/resume, etc).
-
- This is mostly true. You also should make sure that you
- never post Alerts in the background, instead, do something
- like:
-
- EnsureInFront ( ) ;
- Alert ( ... ) ;
-
- where EnsureInFront returns if you ARE in front, or posts a
- notification and waits until you get into front if you're
- not.
-
- 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".
-
- DO not change the front applications forcibly. Don't. No.
- (Well, I have a reason for doing it, but YOU shouldn't :-)
-
- You should call AEInteractWithUser when you "need" to get
- to the front and can't resort to posting a notification and
- waiting.
-
- AEInteractWithUser is safe to call even if you're not handling
- an apple event, though, I was told by one of the engineers at
- the Apple Events panel at the WWDC. Cool. So AEInteractWithUser
- is preferred to SetFrontProcess.
-
- --
- Jon W{tte, Svartmangatan 18, S-111 29 Stockholm, Sweden
-
- ### You have the Easy Access virus. This virus may cause strange sounds
- ### and weird keyboard behaviour when you press the shift key repeatedly.
-