Re: NSTextView problem
Re: NSTextView problem
- Subject: Re: NSTextView problem
- From: Mike Dean <email@hidden>
- Date: Thu, 02 Jan 2003 11:23:12 -0700
Thanks. My goal is just to assure that the insertion point is at the end of
the textview before my program spits output into the view. The user may have
moved the cursor and added some comments to "annotate" previous program
output.
- Mike
>
>> Douglas Davidson <email@hidden> 01/02/03 11:18AM >>>
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.