Re: Quit application when window closes

2008-03-12 Thread Kyle Sluder
On Tue, Mar 11, 2008 at 6:22 AM, Felipe Monteiro de Carvalho <[EMAIL PROTECTED]> wrote: > How can I implement the behavior that the application closes when my > window closes? Please don't do this if you've got a document-based application. It's best for apps that display only one dialog, like

Re: Quit application when window closes

2008-03-12 Thread Joachim Deelen
You could use: - (void)windowWillClose:(NSNotification*)notification { [aboutWindow setDelegate:nil]; [NSApp terminate:self]; } Replace "aboutWindow", with your window. You could also use [NSApp stop:self] but terminate ends more gracefully... Am 12.03.2008 um 00:51 schrieb

Re: Quit application when window closes

2008-03-11 Thread Felipe Monteiro de Carvalho
Thanks for the answers, this indeed works very well. Delegates are quite easy to work with! But what if I wanted to have a "main window". i.e. the application only closes when this window is closed? I did a small search, and I see I can set a delegate for windowWillClose, but I wonder if this is t

Re: Quit application when window closes

2008-03-11 Thread Kevin Dixon
you may have to find a different solution, since you're not using Nib files. Hope that helps, -Kevin > > Message: 12 > Date: Tue, 11 Mar 2008 07:22:17 -0300 > From: "Felipe Monteiro de Carvalho" > <[EMAIL PROTECTED]> > Subject: Quit application w

Re: Quit application when window closes

2008-03-11 Thread Ron Fleckner
On 11/03/2008, at 9:22 PM, Felipe Monteiro de Carvalho wrote: Hello, How can I implement the behavior that the application closes when my window closes? The application contains no nib files and doesn't use the interface builder, it's every thing done by code. thanks, -- Felipe Monteiro de

Quit application when window closes

2008-03-11 Thread Felipe Monteiro de Carvalho
Hello, How can I implement the behavior that the application closes when my window closes? The application contains no nib files and doesn't use the interface builder, it's every thing done by code. thanks, -- Felipe Monteiro de Carvalho ___ Cocoa-de