On 1 Aug 2007, at 00:37, Yen-Ju Chen wrote:
> Maybe we should file a feature request to GNUstep ?
Or I could just implement it. Here's the diff, let me know if you
have any problems (if there aren't any, can someone push it upstream;
the FSF now have my copyright assignment form):
*** NSApplication.m.original Tue Jul 3 19:21:11 2007
--- NSApplication.m Wed Aug 1 01:09:50 2007
***************
*** 31,36 ****
--- 31,39 ----
#include "config.h"
#include <stdio.h>
+ #ifdef HAVE_UNISTD_H
+ #include <signal.h>
+ #endif //HAVE_UNISTD_H
#include <Foundation/NSArray.h>
#include <Foundation/NSAutoreleasePool.h>
***************
*** 95,100 ****
--- 98,113 ----
static NSUncaughtExceptionHandler *defaultUncaughtExceptionHandler;
/*
+ * Terminate cleanly if instructed.
+ */
+ #ifdef HAVE_UNISTD_H
+ void terminateApp(int sig)
+ {
+ [NSApp terminate:nil];
+ }
+ #endif //HAVE_UNISTD_H
+
+ /*
* Gui library user friendly exception handler
*/
static void
***************
*** 455,460 ****
--- 468,476 ----
tileCell = [[NSCell alloc] initImageCell: tileImage];
RELEASE(tileImage);
[tileCell setBordered: NO];
+ #ifdef HAVE_UNISTD_H
+ signal(SIGINT, terminateApp);
+ #endif //HAVE_UNISTD_H
}
- (BOOL) acceptsFirstMouse: (NSEvent*)theEvent
_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss