Re: NSTextView problem
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.