On May 8, 5:32=A0pm, Gregory Weston <u...@[EMAIL PROTECTED]
> wrote:
> In article
> <e3edac8f-936f-4005-b901-867f8a2c6...@[EMAIL PROTECTED]
>,
>
>
>
>
>
> =A0p2 <pradip.pa...@[EMAIL PROTECTED]
> wrote:
> > On May 5, 3:29=A0pm, Gregory Weston <u...@[EMAIL PROTECTED]
> wrote:
> > > In article
> > > <986b1cb2-90f2-4014-a874-a030d49e1...@[EMAIL PROTECTED]
>,
>
> > > =A0p2 <pradip.pa...@[EMAIL PROTECTED]
> wrote:
> > > > On May 3, 3:34=A0pm, Gregory Weston <u...@[EMAIL PROTECTED]
> wrote:
>
> > > > > I mean define a new subclass of NSView which knows (because it's
a=
n
> > > > > NSResponder and you've overridden the method that controls the
res=
ponse
> > > > > to key equivalents) what to do when Cmd-W is pressed. Then make
th=
e
> > > > > window's content view an instance of that subclass in the nib
file=
..
>
> > > > > Of course the window itself is also a responder, so you could go
t=
hat
> > > > > route instead of changing the content view. You just end up
sendin=
g the
> > > > > resulting message to self instead of [self window].
>
> > > > But i am not getting cmd+w key event altogether in keyDown as well
a=
s
> > > > flagsChanged.
> > > > Is there any thing to do to get cmd+w altogether ?
>
> > > Yes. You need to override how your custom class responds to key
> > > equivalents. Read the NSResponder do***entation. It's a class with
whi=
ch
> > > you should really familiarize yourself.
>
> > Thanks for continuing sup****t,
> > I have read the NSResponder & Event mechanism in cocoa.
> > In my case, cmd+w comes under Key equivalents and it handled by
> > overwriting performKeyEquivalent:
> > Application send it to NSView and subviews and then after NSButton,
> > NSMenu etc..
> > but it is not come under my overwritten performKeyEquivalent method.
>
> > Below are some details abt my custom class.
> > My custom class is derived from NSWindowController and also i set
> > NSWindow delegate to ny custom class.
>
> > How can i get this event in my custom class ? Is any thing missing ?
>
> Yes. You're missing the fact that I noted multiple times that you should
> subclass NSView or NSWindow for this behavior. It has to be an
> NSResponder subclass and it has to be in the active responder chain.
>
> --
> "Harry?" Ron's voice was a mere whisper. "Do you smell something ...
burni=
ng?"
> =A0 =A0- Harry Potter and the Odor of the Phoenix- Hide quoted text -
>
> - Show quoted text -
But the NSWindowController is also derived from NSResponder
p2


|