OK, here's the situation. I have:
- A
Webview
- Lots of
NSTextField
s - Other unrelated controls
Normally, the Edit > Undo menu item links to First Responder's undo:
action. And everything works fine + you can even "undo" while typing in an NSTextField
.
Now, what if I want to handle this "undo" action, in a different way, only for my WebView.
I've been thinking of two approaches:
Link the "Undo" item to a custom action and check who is the First Responder. If it's the Webview, then do what needs to be done. Else, "pass" the event to the control. (However, when attempting a
[FIRST_RESPONDER performSelector:@selector(undo:)]
, first it doesn't seem to recognize the selector and last but not least nothing happens.)Link the "Undo" to the first responder's
undo:
(as usual), subclass the Webview and add a custom- (void)undo:(id)sender
action. In that case though, when the webview is active, the "Undo" item is grayed-out, so I can't do anything whatsoever, not even check whether the custom method would be called.
Suggestions? How would you go about that?
What am I missing?