• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextView: Detecting when caret moves out of line
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: NSTextView: Detecting when caret moves out of line (From: Satoshi Matsumoto <email@hidden>)

  • Prev by Date: prebinding hell
  • Next by Date: Changing the text of an NSTextView without killing undos
  • Previous by thread: Re: NSTextView: Detecting when caret moves out of line
  • Next by thread: How to get the size of a paper
  • Index(es):
    • Date
    • Thread