Thread View: comp.sys.next.programmer
3 messages
3 total messages
Started by Bill Shirley [CSC]
Tue, 25 Aug 1992 14:20
[NXApp run]
Author: Bill Shirley [CSC]
Date: Tue, 25 Aug 1992 14:20
Date: Tue, 25 Aug 1992 14:20
39 lines
1723 bytes
1723 bytes
Does the -run method of Application NEED to be invoked. I need a little bit more control over the event loop. (NO, I didn't design it poorly, I didn't design it. I am trying to integrate an old program into a NeXTSTEP environment.) The program I'm trying to write a front end for (it was command line) calls a function that is equivalent to getc, and this function needs to return a character, probably dispatching other events while waiting for the character to come in. It's easy to get an event, but if I didn't wan't it how can I dispatch it? there's [NXApp getEvent: mask: threshhold:] (I don't have my manuals in front of me and I know that's wrong but you get the gist) Ok, I can limit the events to KEYPRESS, but what if it's a command-key or a control-key, or alt-key,... Is there a way to dispatch these event's that I didn't want to get? Should I peek and then take? Is it ok never to call [NXApp run] and deal with all your events otherwise? It would be nice if there was an [NXApp dispatch:event]. pondering... -- Bill Shirley | ``Computer Science is not about computers any shirley@fdr.jsc.nasa.gov| more than astronomy is about telescopes.'' -- Bill Shirley | ``Computer Science is not about computers any shirley@fdr.jsc.nasa.gov| more than astronomy is about telescopes.''
Re: [NXApp run]
Author: John Jay Feiler
Date: Fri, 28 Aug 1992 06:18
Date: Fri, 28 Aug 1992 06:18
23 lines
1399 bytes
1399 bytes
In article <1992Aug25.092051@fdr.jsc.nasa.gov> shirley@fdr.jsc.nasa.gov (Bill Shirley [CSC]) writes: > > Does the -run method of Application NEED to be invoked. > > I need a little bit more control over the event loop. > > (NO, I didn't design it poorly, I didn't design it. I am trying > to integrate an old program into a NeXTSTEP environment.) > > The program I'm trying to write a front end for (it was command line) > calls a function that is equivalent to getc, and this function needs > to return a character, probably dispatching other events while waiting > for the character to come in. What about doing a DPSAddFD on the file descriptor of whatever you are "getc"ing from. The you can still use -run, and your getc stuff will be checked once every "run" event loop. > -- > Bill Shirley | ``Computer Science is not about computers any > shirley@fdr.jsc.nasa.gov| more than astronomy is about telescopes.''
Re: [NXApp run]
Author: Jim Large
Date: Mon, 31 Aug 1992 14:30
Date: Mon, 31 Aug 1992 14:30
42 lines
1713 bytes
1713 bytes
In article <1992Aug25.092051@fdr.jsc.nasa.gov> shirley@fdr.jsc.nasa.gov (Bill
Shirley [CSC]) writes:
>
> Does the -run method of Application NEED to be invoked.
> I need a little bit more control over the event loop.
I've found that some desirable things happen when -[Application run] is
called. The only one I know about for sure is that the application's icon
(which is highlighted when you launch the app) becomes unhighlighted.
That's why I did the following when I had to port an alien program to
NeXTStep:
@interface Controller:Object
@end
@implementation Controller
- appDidInit:sender {
[NXApp stop];
return self;
}
@end
void main(
int argc,
char *argv[]
)
/*main*/ {
NXApp = ...
...
[NXApp setDelegate:[[Controller alloc] init]];
[NXApp run];
while( 1 )
/*main loop*/ {
...
/*main loop*/ }
/*main*/ }
----------------+------------------+------------------------------------
|\ /| | Jim Large | Visual Understanding Systems, Inc.
| V | | jml@visus.com | 2100 Wharton St.
\_| |__ | (412)488-3600 | Pittsburgh, PA 15203
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