textView scrolling

mfhaque

Registered
how do i get the scroll bar of textView to stay at the bottom always. for example, if i add couple extra rows to a full textView, i want it to scroll to the button to the new entries without the user scrollin down to see it. thanks.
 
The best thing I can come up with is this:
NSScrollView (NSTextView's from IB are automatically wrapped in an NSScrollView) has a contentView that displays inforamtion. It's an instance of NSClipView. NSClipView has an instance method called scrollToPoint which changes the origin of the NSClipView to the provided NSPoint. I think all you have to do is look at NSTextView's delegates and catch each time info is added to the NSTextView and call scrollToPoint to the the bottom.

In the words of my math professor: The rest I leave to you to do at home as an excercise :)

HTH,
F-bacher
 
I'm working in java/cocoa and I can't get that behaviour. I can get a button to press and the button to call the MoveDown() method and that's sweet and all, but I have yet to be able to do it from code.

If you figure it out, post back, it's been a thorn in my side for about 10 days now.
 
Back
Top