Re: Adding subview
Re: Adding subview
- Subject: Re: Adding subview
- From: Johan Kool <email@hidden>
- Date: Mon, 23 Jun 2003 16:39:20 +0200
This works for me to add a subview to a scrollview:
- (void)getSpectrum:(int)scan
{
// int scan;
SomeView *newView;
int count;
count = [[[scrollView documentView] subviews] count];
newView = [[SomeView alloc] init];
[newView setFrame:NSMakeRect(0.0,250.0*count,[[scrollView
documentView] frame].size.width,250.0)];
[scrollView setLineScroll:250.0];
[scrollView setPageScroll:250.0];
[scrollView setAutoresizesSubviews:YES];
[[scrollView documentView] addSubview:newView];
[[scrollView documentView] setFrame:NSMakeRect(0.0,0.0,[[scrollView
documentView] frame].size.width,250.0*(count+1))];
[scrollView setNeedsDisplay:YES];
[newView release];
}
See what you can do with it.
Regards,
Johan Kool
_______________________________________________
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.