• 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 problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView problem


  • Subject: Re: NSTextView problem
  • From: Douglas Davidson <email@hidden>
  • Date: Thu, 2 Jan 2003 10:18:18 -0800

On Tuesday, December 31, 2002, at 05:32 PM, Mike Dean wrote:

I have a textview into which programmatic output is inserted. However, I want the view to be editable so that the user can add comments, etc. anywhere in the view. When the program itself is ready to insert text, however, I need to reset the insertion point to the end of the text view. For the life of me I cannot find a method that does this. Am sure I am missing something obvious. Thanks.

[textView setSelectedRange:NSMakeRange(textLength, 0)]

But actually, it is not necessary to set the selected range in order to make programmatic modifications to the text, unless you happen to be doing so through one of the NSTextView methods that is intended primarily for handling user actions. Programmatic modifications to the text can be made by modifying the underlying text storage directly.

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.

  • Prev by Date: Re: Symbol font
  • Next by Date: "Suitcase" messing with fonts chosen in nib files?
  • Previous by thread: Selected menu bar pattern?
  • Next by thread: Re: NSTextView problem
  • Index(es):
    • Date
    • Thread