Re: NSScrollView Not Updating
Re: NSScrollView Not Updating
- Subject: Re: NSScrollView Not Updating
- From: Pierce Freeman <email@hidden>
- Date: Sat, 25 Jul 2009 19:59:50 -0700
- Thread-topic: NSScrollView Not Updating
> You need to post your code.
I'll put my "main" code at the end of this email.
>
> It sounds like you've overridden -drawRect: to draw custom contents.
> The view's frame determines how the scroll view behaves; if you're
> just drawing all over the place in -drawRect: without properly calling
> -setFrame:, you need to stop that.
I'm not quite sure if I'm over riding -drawRect:, but it's possible that I
have. Hopefully my code will see if I have.
AppController.m
@interface AppController : NSObject {
IBOutlet NSView *subView;
IBOutlet NSScrollView *mainView;
}
@end
AppController.h
for (NSInteger i = 0; i < 100; i++)
{
NSRect location = NSMakeRect(50, (i*120 + (i+9)*10), 400, 22);
NSTextField *text1 = [[NSTextField alloc]
initWithFrame:location];
[subView addSubview:text1];
[subView setAutoresizesSubviews:YES];
}
_______________________________________________
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