Re: Can seem to get any delegate messages with NSWindow
Re: Can seem to get any delegate messages with NSWindow
- Subject: Re: Can seem to get any delegate messages with NSWindow
- From: Matt Neuburg <email@hidden>
- Date: Fri, 20 Jul 2007 13:07:02 -0700
- Thread-topic: Can seem to get any delegate messages with NSWindow
On Thu, 19 Jul 2007 17:56:20 -0600, Rick Meier <email@hidden>
said:
>I have created a window programatically using:
>
> NSRect5 rect = ...
> NSWindow *pWin = [[NSWindow alloc] initWithContentRect:rect
> styleMask:NSBorderlessWindowMask
> backing:NSBackingStoreBuffered
> defer:NO];
> [pWin setDelegate:delegate];
>
>
>I have a - (BOOL)windowShouldClose:(id)sender; method in my delegate.
>
>I call [pWin performClose:self] from a view inside of the window but
>the delegate never gets called.
>
>I have checked the delegate with [pWin delegate] and it is set to my
>object.
>
>Do I need to do something to my window so that the messages will be
>sent/received.
>
>This app does not have a NIB (and will not) so I have to do it
>programmatically.
>
>Any ideas?
A borderless window has no close button, so you cannot tell it to
performClose. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: <http://tinyurl.com/2rh4pf>
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden