Re: NSTextView: Detecting when caret moves out of line
Re: NSTextView: Detecting when caret moves out of line
- Subject: Re: NSTextView: Detecting when caret moves out of line
- From: Jens Bauer <email@hidden>
- Date: Fri, 28 Nov 2003 04:49:47 +0100
Hi Satoshi,
On Friday, November 28, 2003, at 03:11 AM, Satoshi Matsumoto wrote:
on 03.11.28 4:39 AM, Jens Bauer at email@hidden wrote:
How do I correctly detect if the cursor/caret/insertion point has
moved
away from a line in a NSTextView ?
You can catch the selection change with following NSTextView delegete
method.
- (NSRange)textView:(NSTextView *)textView
willChangeSelectionFromCharacterRange:(NSRange)oldSelectedCharRange
toCharacterRange:(NSRange)newSelectedCharRange;
If the oldSelectedCharRange is not continuous with
newSelectedCharRange,
that is the change you want to detect.
This is great information, thankyou very much. I would guess that that
wouldn't let me know if another window was clicked, so the window lost
focus, however, I've seen some methods for finding out whether or not
the NSTextView receives or lose focus.
Thanks. I'll definitely try this out! =)
Love,
Jens
_______________________________________________
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.