> Richard Frith-Macdonald wrote:
> > On 13 Sep 2006, at 12:14, pradip patel wrote:

> > How can I close whole application from title bar controls- close 
> > button

> Applications are not supposed to terminate when the window closes ... 

The easiest way is probably to implement the method
  - (BOOL) applicationShouldTerminateAfterLastWindowClosed: (id)sender
in the delegate.

1. Create your own application delegate class and attach the
   delegate object to the application object if you haven't
   done this yet.
   For example, my main() is literally this:

int main (int argc, const char **argv)
{
    NSAutoreleasePool * pool = [NSAutoreleasePool new];
    
    [NSApplication sharedApplication];
    [NSApp setDelegate: [AppController new]]; // AppController is your
own

    return NSApplicationMain(argc, argv);
}

2. Add the following method to AppController class

- (BOOL) applicationShouldTerminateAfterLastWindowClosed: (id)sender
{
    return YES;
}

--Tima


_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to