home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 12791 < prev    next >
Encoding:
Text File  |  1992-07-21  |  2.1 KB  |  56 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!mcsun!sunic!kth.se!dront.nada.kth.se!d88-jwa
  3. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  4. Subject: Re: Moving to the foreground after receiving an 'odoc' from the Finder
  5. In-Reply-To: jcav@quads.uchicago.edu's message of Tue, 21 Jul 1992 16:12:51 GMT
  6. Message-ID: <D88-JWA.92Jul21225659@dront.nada.kth.se>
  7. Originator: d88-jwa@dront.nada.kth.se
  8. Sender: usenet@kth.se (Usenet)
  9. Nntp-Posting-Host: dront.nada.kth.se
  10. Organization: Royal Institute of Technology, Stockholm, Sweden
  11. References: <D2150035.8p3ep6@outpost.SF-Bay.org>
  12.     <mxmora-200792113832@css-mac1.sri.com>
  13.     <1992Jul20.195334.19197@newstand.syr.edu>
  14.     <1992Jul21.161251.7693@midway.uchicago.edu>
  15. Date: Tue, 21 Jul 1992 21:56:59 GMT
  16. Lines: 38
  17.  
  18. .uchicago.edu> jcav@quads.uchicago.edu (JohnC) writes:
  19.  
  20.    This is the root of your problem.  If you accept high-level events, you also
  21.    _must_ accept OS events (suspend/resume, etc).
  22.  
  23. This is mostly true. You also should make sure that you
  24. never post Alerts in the background, instead, do something
  25. like:
  26.  
  27.     EnsureInFront ( ) ;
  28.     Alert ( ... ) ;
  29.  
  30. where EnsureInFront returns if you ARE in front, or posts a
  31. notification and waits until you get into front if you're
  32. not.
  33.  
  34.    If you want to be absolutely sure you're in front, you can call
  35.    _SetFrontProcess (I think that's the name) with your own process serial #.
  36.    However, I suspect that if you handle your suspend/resume events by the
  37.    book, the other problems should "factor out".
  38.  
  39. DO not change the front applications forcibly. Don't. No.
  40. (Well, I have a reason for doing it, but YOU shouldn't :-)
  41.  
  42. You should call AEInteractWithUser when you "need" to get
  43. to the front and can't resort to posting a notification and
  44. waiting.
  45.  
  46. AEInteractWithUser is safe to call even if you're not handling
  47. an apple event, though, I was told by one of the engineers at
  48. the Apple Events panel at the WWDC. Cool. So AEInteractWithUser
  49. is preferred to SetFrontProcess.
  50.  
  51. -- 
  52.          Jon W{tte, Svartmangatan 18, S-111 29 Stockholm, Sweden
  53.  
  54. ### You have the Easy Access virus. This virus may cause strange sounds
  55. ### and weird keyboard behaviour when you press the shift key repeatedly.
  56.