🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #351

How to deactivate an application AND activate the previous one?

#351
From: Yeong-Ho Yu
Date: Thu, 30 Jul 1992 13:18
33 lines
1782 bytes
When you quit an application, the application which was active
right before the quitting one gets activated.  I want to mimic
this behavior except that I want to deactivate, not quit, an application.
What I am trying to do is to develop a very small keymap change utility 
which has only a button and changes the keymap when a user pushes the button.
So, if a user is using WriteNow and wants to change the keymap to a foreign
language, the user can click on the button.  However, currently, if 
the user wants to continue on WriteNow, s/he has to click on WriteNow again
to activate it.  I want the utility to deactivate itself as soon as it
changes the keymap and automagically activate whatever application which
was active previously (WriteNow, in the example above), so that the user
does not have to click on it.

I tried 
[NXApp deactivateSelf]

but it only deactived itself; so no active application.

I tried to capture the postscript context of the previous application
by putting

int caller = [NXApp activeApp]

either in the action routine of the utility button or
appDidBecomeActive method of the utility application, but
the value seemed to have changed to that of the utility already.
(I wish they had a method called appWillBecomeActive.)

Please reply to yu@cs.utexas.edu
Any help would be appreciated very much.

Yeong Yu
-----------
Technical Details
Message-ID: <l7fr1cINNse8@ai.cs.utexas.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!cs.utexas.edu!news

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!cs.utexas.edu!news
From: yu@cs.utexas.edu (Yeong-Ho Yu)
Newsgroups: comp.sys.next.programmer
Subject: How to deactivate an application AND activate the previous one?
Date: 30 Jul 1992 08:18:36 -0500
Organization: CS Dept, University of Texas at Austin
Lines: 33
Message-ID: <l7fr1cINNse8@ai.cs.utexas.edu>
NNTP-Posting-Host: ai.cs.utexas.edu
Keywords: activate