Scroll an NSTextView to a new place
Scroll an NSTextView to a new place
- Subject: Scroll an NSTextView to a new place
- From: John Stiles <email@hidden>
- Date: Tue, 19 Feb 2008 09:34:54 -0800
How do you change the scroll location of an NSTextView+NSScrollView
programmatically?
I've got code which seems like it ought to work, but when I call it, it
causes the text view's contents to vanish (the text view appears to have
nothing in it). If I resize the text view, it fixes and shows the
expected results, but this seems to indicate that I'm not doing
something right.
What I've got now:
NSRect visibleRect = [myTextView visibleRect];
NSClipView* clipView = [myScrollView contentView];
[clipView scrollToPoint:NSMakePoint(visibleRect.origin.x,
newVerticalPosition)];
[myScrollView reflectScrolledClipView:clipView];
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden