Re: Simple view in NSScrollView
Re: Simple view in NSScrollView
- Subject: Re: Simple view in NSScrollView
- From: Stephan Burlot <email@hidden>
- Date: Mon, 23 Jul 2007 14:54:11 +0200
Found it: of course the rect passed to drawRect != frame of the view.
Duh.
Le 23 juil. 07 à 12:43, Stephan Burlot a écrit :
Hi,
I've set up a simple NSView subclass that just draw a text when
called. This view is enclosed in a NSScrollView.
When I scroll slowly, only part of the text is drawn, with left
over of the previous text. If I scroll using page up/down, all text
is displayed.
My custom view doesnt do anything special. It's just a flipped view.
This is the drawRect method of my view:
- (void)drawRect:(NSRect)rect
{
NSPoint p;
[self lockFocus];
[[NSColor whiteColor] set];
[NSBezierPath fillRect:rect];
p = rect.origin;
p.y = p.y + 5;
p.x += 5;
[headerText drawAtPoint:p withAttributes:NULL];
[self unlockFocus];
}
What can be wrong here?
Thanks,
Stephan
_______________________________________________
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:
40coriolis.ch
This email sent to email@hidden
_______________________________________________
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