home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / next / programm / 5360 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  1.7 KB

  1. Path: sparky!uunet!usc!cs.utexas.edu!news
  2. From: yu@cs.utexas.edu (Yeong-Ho Yu)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: How to deactivate an application AND activate the previous one?
  5. Date: 30 Jul 1992 08:18:36 -0500
  6. Organization: CS Dept, University of Texas at Austin
  7. Lines: 33
  8. Message-ID: <l7fr1cINNse8@ai.cs.utexas.edu>
  9. NNTP-Posting-Host: ai.cs.utexas.edu
  10. Keywords: activate
  11.  
  12. When you quit an application, the application which was active
  13. right before the quitting one gets activated.  I want to mimic
  14. this behavior except that I want to deactivate, not quit, an application.
  15. What I am trying to do is to develop a very small keymap change utility 
  16. which has only a button and changes the keymap when a user pushes the button.
  17. So, if a user is using WriteNow and wants to change the keymap to a foreign
  18. language, the user can click on the button.  However, currently, if 
  19. the user wants to continue on WriteNow, s/he has to click on WriteNow again
  20. to activate it.  I want the utility to deactivate itself as soon as it
  21. changes the keymap and automagically activate whatever application which
  22. was active previously (WriteNow, in the example above), so that the user
  23. does not have to click on it.
  24.  
  25. I tried 
  26. [NXApp deactivateSelf]
  27.  
  28. but it only deactived itself; so no active application.
  29.  
  30. I tried to capture the postscript context of the previous application
  31. by putting
  32.  
  33. int caller = [NXApp activeApp]
  34.  
  35. either in the action routine of the utility button or
  36. appDidBecomeActive method of the utility application, but
  37. the value seemed to have changed to that of the utility already.
  38. (I wish they had a method called appWillBecomeActive.)
  39.  
  40. Please reply to yu@cs.utexas.edu
  41. Any help would be appreciated very much.
  42.  
  43. Yeong Yu
  44. -----------
  45.