• 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: setting the insertion point in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting the insertion point in NSTextView


  • Subject: Re: setting the insertion point in NSTextView
  • From: Timothy Ritchey <email@hidden>
  • Date: Fri, 7 Feb 2003 10:35:42 -0500

If you want to set the insertion point to charIndex, you should do something like:

[aTextView setSelectedRange: NSMakeRange(charIndex, 0)];

Cheers,
tim

On Friday, February 7, 2003, at 10:12 AM, Koen van der Drift wrote:

Hi,

I have an NSTextView that uses temporary attributes to hilite certain characters. This now all works fine. But when I insert a character in the text, after setting the attributes, the cursor/drawcaret/insertion point moves to the end of the text. So I thought I get the position of the insertionpoint (using selectedRange, range.location is where the insertion point is), change the attributes, and then set the insertion point back to the 'correct' position. The only method I found to set the insertionpoint is drawInsertionPointInRect. How do I convert the location to a Rect?

thanks,

- Koen.
_______________________________________________
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.
_______________________________________________
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: 
 >setting the insertion point in NSTextView (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Re: bad memory access problem
  • Next by Date: Re: dismissing sheets.
  • Previous by thread: setting the insertion point in NSTextView
  • Next by thread: Java/Cocoa vs Java/ObjC/Cocoa vs Java/Swing
  • Index(es):
    • Date
    • Thread