Re: Capturing every keypress in an NSTextView
Re: Capturing every keypress in an NSTextView
- Subject: Re: Capturing every keypress in an NSTextView
- From: Douglas Davidson <email@hidden>
- Date: Tue, 21 Jan 2003 09:44:41 -0800
On Tuesday, January 21, 2003, at 06:04 AM, j o a r wrote:
On Tuesday, Jan 21, 2003, at 14:52 Europe/Stockholm, Chaffinch wrote:
I see plenty of examples of using controlTextDidChange to capture key
presses
for a text field. But what is the equivalent for an NSTextView?? ie.
when the
user enters a character I want to be notified.
NSTextView has a did-change notification, NSTextDidChangeNotification,
defined in the superclass NSText. The delegate will automatically
receive this via the method textDidChange:, if the delegate implements
that method.
NSTextView also has a delegate method,
textView:shouldChangeTextInRange:replacementString:, that allows the
delegate to be notified before the change takes place and to intervene
to prohibit or modify the change.
Douglas Davidson
_______________________________________________
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.