Skip navigation.
 
mlRe: NSWindow
FROM : Lachlan Deck
DATE : Sat Jan 18 21:10:41 2003

Hi there,

On Sunday, January 19, 2003, at 05:05 AM, Shaun Wexler wrote:

> On Saturday, January 18, 2003, at 09:50  AM, Matis Schotte wrote:
>

>> hi,
>> Which function is called when a window closes? i will bring up a
>> save/dont save dialog when a NSWindow closes by the user ...
>> thx for answers!! :)
>> smat

>
> Add this to your program, in the object in which you wish to perform
> the save/don't save dialog:
>
>     [[NSNotificationCenter defaultCenter] addObserver:self
> selector:@selector(windowWillClose:) name:NSWindowWillCloseNotification
> object:window];
>
>
> - (void) windowWillClose:(NSNotification *)notification
> {
>     NSWindow *windowAboutToClose = [notification object];
>
>     if (windowAboutToClose == myWindow)


Shouldn't that be:
   if ([windowAboutToClose isEqual:myWindow])

it is a pointer to an object after all and not a basic data type...

with regards,

--
Lachlan Deck
<email_removed>
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlNSWindow Matis Schotte Jan 18, 18:50
mlRe: NSWindow j o a r Jan 18, 19:05
mlRe: NSWindow Shaun Wexler Jan 18, 19:05
mlRe: NSWindow mw Jan 18, 19:20
mlRe: NSWindow Shaun Wexler Jan 18, 19:42
mlRe: NSWindow Lachlan Deck Jan 18, 21:10
mlRe: NSWindow Shaun Wexler Jan 18, 22:06
mlRe: NSWindow Matis Schotte Jan 18, 22:29
mlRe: NSWindow Daryn Jan 19, 04:11