home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20419 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  1.6 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!geraldo.cc.utexas.edu!rick
  2. From: rick@akbar.cc.utexas.edu (Rick Watson)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Forcing a process switch
  5. Date: 30 Dec 1992 06:04:42 GMT
  6. Organization: University of Texas at Austin
  7. Lines: 26
  8. Sender: r.watson@utexas.edu
  9. Distribution: world
  10. Message-ID: <1hre5qINNrc2@geraldo.cc.utexas.edu>
  11. NNTP-Posting-Host: akbar.cc.utexas.edu
  12. Keywords: process-manager, tooxbox-managers
  13.  
  14. I have a trap patch that needs to invoke a modal dialog. Yes, I know
  15. this sounds strange, but please ignore that for now. The patch may be
  16. executed by any application at any time, including before the app has
  17. initialized any of the toolbox managers -- I won't know
  18. what state the app is in.
  19.  
  20. My current implementation uses the process manager to launch another
  21. application to do the user interaction. I execute a GetNextEvent
  22. loop with a mask selecting no events to force the process switch.
  23. The launch works fine. Unfortunately, you can't call GetNextEvent
  24. until some of the toolbox managers have been initialized.
  25. Is there a workaround? I discovered that I could workaround the
  26. problem by setting the background only bit in the first app's
  27. size resource, but this is not an option for the case I'm trying
  28. to solve. Is there any way to make the current process a bkgnd only
  29. process for a short while?
  30.  
  31. Alternatively, is there any way to detect which toolbox managers
  32. have been initialized? I could at least avoid crashing by not
  33. executing the patch code in the case where the app is in
  34. the wrong state.
  35.  
  36. Rick Watson
  37. The University of Texas Computation Center, Networking Services, 512/471-3241
  38.   r.watson@utexas.edu
  39.  
  40.