Re: scrollPoint in NSScrollView does not scroll
Re: scrollPoint in NSScrollView does not scroll
- Subject: Re: scrollPoint in NSScrollView does not scroll
- From: Keary Suska <email@hidden>
- Date: Mon, 17 Jun 2013 09:20:58 -0600
On Jun 17, 2013, at 8:38 AM, Keary Suska wrote:
> NSScrollView* myscrollview = [[NSScrollView alloc] initWithFrame:NSMakeRect(0, 0, 200, 200)];
> NSClipView* myclipview = [[NSClipView alloc] initWithFrame:NSMakeRect(0, 0, 500, 400)];
> [myscrollview setHasVerticalScroller:YES];
> [myscrollview setHasHorizontalScroller:YES];
> [myscrollview setDocumentView:myclipview];
>
> [[myscrollview documentView] scrollPoint:NSMakePoint(300.0, 300.0)];
>
> [self.window.contentView addSubview:myscrollview];
It may also be useful to mention that this code is all wrong. NSScrollView creates its own NSClipView, which is its contentView. NSClipView, AFAIK, will not function well as a standard view.
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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