Field editor delegate doesn't work
Field editor delegate doesn't work
- Subject: Field editor delegate doesn't work
- From: Sailor Quasar <email@hidden>
- Date: Mon, 7 Jul 2003 22:44:51 -0400
I have an NSTextField in an NSWindow (natch :). In the window
controller's awakeFromNib: method, I call [[window fieldEditor:YES
forObject:textField] setDelegate:self]. I then in that same controller
have an implementaion of
-textView:shouldChangeTextInRange:replacementString:. The method is
never called. I've verified this by placing an NSLog() at the top of
the method, and I get nothing. How can I intercept key events relevant
to the NSTextField in my window? Aside, of course, from my current
horrible hack that subclasses NSApplication and overrides -sendEvent:
to intercept NSKeyDown events and pass them on manually... I know, I
could have just subclassed NSWindow's -sendEvent:, but at the time I
hadn't done enough research into the event system to quite realize that
:). In either case, I'd rather avoid subclassing altogether by using
the delegate method. Modularity! Why require support from an
NSApplication or NSWindow subclass to do something that can be done in
window controller without even subclassing NSTextField?
-- Sailor Quasar, just another player in The World
"Come with me in the twilight of the summer night for awhile"
Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.