close application from title bar control - close - more than one window

"pradip patel" <[email protected]> Thu, 14 Sep 2006 13:10:25 +0530
Newsgroups gmane.comp.lib.gnustep.user,gmane.comp.lib.gnustep.general,gmane.comp.lib.gnustep.applications
Message-ID <[email protected]>
Hi Marco,,

 

That's done..

Application is closed when I have only one window

 

 

But as I noticed the problem is that..

 

I have more than one window..

One is main which I close from close button.

And other - close button is disabled..

 

I want to closed application when I closed main window..---(more than one
window is there..)

 

windowWillClose  is useful to me?

 

pradip

  _____  

From: Mark Horner [mailto:[email protected]] 
Sent: Thursday, September 14, 2006 11:42 AM
To: pradip patel
Subject: Re: problem close application from title bar control - close

 

not sure, you may have to send me your code so I can have a look

--

Regards

 

Mark Horner, Chartered Architect

01580 714506

07976 928586

Orchard Lodge

Dorothy Avenue

Cranbrook, Kent TN17 3AY





 

On 14 Sep 2006, at 07:04, pradip patel wrote:





Hi Marco

 

I tried as  per your instruction..

 

I write

- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication
*)theApplication 

it returns YES

after that

-(void)applicationWillTerminat: (NSNotification*)  --- in this I release
stop thred and all objects..

Called.

 

But I have problem.

I have one thread which is running , on closing application first thread
exist and then

applicationShouldTerminateAfterLastWindowClosed

is called..

 

so menu will remain same as earlier ..

 

 

also before I adding this code ..

on closing ..only thread is existing..

applicationWillTerminate not called..

 

can u suggest me what I have to do ?

 

 

pradip

 

 

  _____  

From: Mark Horner [mailto:[email protected]] 
Sent: Wednesday, September 13, 2006 8:55 PM
To: pradip patel
Subject: Re: close application from title bar control - close

 

Pradip

 

Normally MacOS X doesn't close an application when you close all the
windows, this may not be what you are used to if you have used another
systems.

 

If you do this in a word processor, say, you will really upset people who
want to close a window, and then open up a new window, without the
application quitting from underneath them. However, this can sometimes be
used for single-window desk accessory-type apps - think Calculator, not
TextEdit.

 

 

 

You can get the behaviour you want with
applicationShouldTerminateAfterLastWindowClosed:

 

Invoked when the user closes the last window the application has open.

- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication
*)theApplication 

{ 

return YES;

}

This message is sent when the last window is closed regardless of whether
there are still open panels (a panel in this case is defined as being an
instance of NSPanelIf this method returns NO to allow the application to
terminate. Note that
<http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Cla
sses/NSApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/NSOb
ject/applicationShouldTerminate:> applicationShouldTerminate:.

Available in Mac OS X v10.0 and later.

 

 

--

Regards

 

Mark Horner, Chartered Architect

01580 714506

07976 928586

Orchard Lodge

Dorothy Avenue

Cranbrook, Kent TN17 3AY






 

On 13 Sep 2006, at 12:18, pradip patel wrote:






 

Hi Marco

 

Can u plz help me .?

 

Hye created currencyconverter example given by apple..

 

But I have one problem..

 

When I run run program .it shows currencyconverter window.

 

When I close application -from title bar controls - close button ..then
Currency converter Menu is remaining.

 

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

 

pradip

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