Re: What's the magic that makes cmd-w close a window?
Re: What's the magic that makes cmd-w close a window?
- Subject: Re: What's the magic that makes cmd-w close a window?
- From: "Marcus S. Zarra" <email@hidden>
- Date: Tue, 11 Oct 2005 10:59:26 -0600
command-W is attached to "First Responder". That is where the magic
lies. "First Responder" checks the top most window and checks to see
if it responds to the method attached. In the case of command-W it is
attached to "performClose:" which most windows respond to by default.
I am sure someone else will point you to the documentation that
explains all of this better.
Hope that helps.
On 10/11/05, Jerry Krinock <email@hidden> wrote:
> When the user hits cmd-W, the frontmost window should close.
>
> I have done this by making a menu item or button, wiring it to NSWindow's
> -performClose action and assigning cmd-W as its keyboard shortcut. But I am
> trying to clear this excess clutter from my user interface. Note: I am
> particularly interested in non-document windows.
>
> In Apple's TextEdit example, I see that the Preferences window (presumably
> NOT a document window) behaves this way, but I can't find anything in its
> .nib or code to support it. What's the magic??
>
> Jerry
>
> P.S. My apologies for the easy question; indeed a Google search says this
> was discussed in the Cocoabuilder archives, but I can't find it in Apple's
> Mailman archives and Cocoabuilder is down.
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden