Re: How doess Cocoa handle SIGINT?
Re: How doess Cocoa handle SIGINT?
- Subject: Re: How doess Cocoa handle SIGINT?
- From: Greg Titus <email@hidden>
- Date: Mon, 25 Jun 2001 19:14:06 -0700
On Monday, June 25, 2001, at 05:05 PM, Thierry Faucounau wrote:
>
I have some questions relating to the handling of SIGINT from a Cocoa
>
app.
>
>
Does the Cocoa runloop handle signals for you? Or is it OK (in fact
>
required) to put in my own signal handler?
No, Cocoa doesn't do any signal handling for you, so if you did want to
do anything with SIGINT (besides exiting, of course) you'd have to put
in your own. Doing your own signal handler wouldn't interfere at all
with Cocoa.
>
Does hitting Control-C on the keyboard send a SIGINT to the frontmost
>
Cocoa app?
Nope. It just sends a keyboard event that the 'c' key is down with the
control key flag set in the modifiers for the event... (that is, it does
exactly the same thing as any other normal key combination).
Of course, if you start a Cocoa app from the command-line in a shell,
and then hit Control-C in that shell window, the Cocoa app will get sent
a SIGINT, just as the shell would do for any other program.
Hope this helps,
--Greg