Thread View: comp.sys.next.programmer
3 messages
3 total messages
Started by Yeong-Ho Yu
Thu, 30 Jul 1992 13:18
How to deactivate an application AND activate the previous one?
Author: Yeong-Ho Yu
Date: Thu, 30 Jul 1992 13:18
Date: Thu, 30 Jul 1992 13:18
33 lines
1782 bytes
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 -----------
Re: How to deactivate an application AND activate the previous one?
Author: Dave Griffiths
Date: Sat, 01 Aug 1992 22:26
Date: Sat, 01 Aug 1992 22:26
20 lines
1255 bytes
1255 bytes
In article <l7fr1cINNse8@ai.cs.utexas.edu> yu@cs.utexas.edu (Yeong-Ho Yu) writes: >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.) > I agree. I also would like the context of the previous application for a similar reason. In my app I would like to have some buttons which you press when you are in some other app and which do something (eg post events) to the current app. The whole concept of a Service needs to be much broader. Anyone from NeXT care to comment? (I guess I already know the answer :-) Dave Griffiths
Re: How to deactivate an application AND activate the previous one?
Author: Andrew Loewenstern
Date: Mon, 03 Aug 1992 23:35
Date: Mon, 03 Aug 1992 23:35
38 lines
2181 bytes
2181 bytes
In article <1992Aug1.222645.591@prim> prim!dave@germany.eu.net (Dave Griffiths) writes: >In article <l7fr1cINNse8@ai.cs.utexas.edu> yu@cs.utexas.edu (Yeong-Ho Yu) writes: >>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.) >> > >I agree. I also would like the context of the previous application for a >similar reason. In my app I would like to have some buttons which you press >when you are in some other app and which do something (eg post events) to >the current app. The whole concept of a Service needs to be much broader. > >Anyone from NeXT care to comment? (I guess I already know the answer :-) I was flamed by people at NeXT for tinkering with the activeApp in Stylist. Apparently there are some directives for the services file documented _somewhere_ (I think it's in the 2.1 release notes...) for controlling the activation of applications during a services run. Also, NeXT doesn't seem to like it when developers use services for more than the most simple of tasks... it's a shame since services are so *powerful*! andrew <there's just so much good stuff in NeXTSTEP that it becomes hard to 'discover' the more obscure features (and when you do find it, it could be broken... [see 2.1 NXDynamicServices()])> -- andrew@cubetech.com Andrew Loewenstern | "Remember what the doormouse said... Cube Technologies, Inc. | Feed your head." - Jefferson Airplane
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads