Setting the position of a NSScrollView
Setting the position of a NSScrollView
- Subject: Setting the position of a NSScrollView
- From: Dave <email@hidden>
- Date: Wed, 09 Sep 2015 21:54:56 +0100
Found it!
-(void) scrollToTopOfScrollView:(NSScrollView*) theScrollView
{
NSPoint myScrollPosition;
if ([[theScrollView documentView] isFlipped] == YES)
myScrollPosition = NSMakePoint(0.0,0.0);
else
myScrollPosition=NSMakePoint(0.0,NSMaxY([[theScrollView documentView] frame]) - NSHeight([[theScrollView contentView] bounds]));
[[theScrollView documentView] scrollPoint:myScrollPosition];
}
-(void) scrollToBottomOfScrollView:(NSScrollView*) theScrollView
{
NSPoint myScrollPosition;
if ([[theScrollView documentView] isFlipped] == YES)
myScrollPosition=NSMakePoint(0.0,NSMaxY([[theScrollView documentView] frame]) - NSHeight([[theScrollView contentView] bounds]));
else
myScrollPosition = NSMakePoint(0.0,0.0);
[[theScrollView documentView] scrollPoint:myScrollPosition];
}
_______________________________________________
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