Re: NSTableview row-based, not redrawing on 10.9
Re: NSTableview row-based, not redrawing on 10.9
- Subject: Re: NSTableview row-based, not redrawing on 10.9
- From: Michael Cinkosky <email@hidden>
- Date: Fri, 25 Oct 2013 12:47:33 -0600
I believe you need to implement a new delegate method for this table:
+(BOOL) isCompatibleWithResponsiveScrolling {
return NO;
}
https://developer.apple.com/library/prerelease/mac/releasenotes/AppKit/RN-AppKit/index.html#//apple_ref/doc/uid/TP30000741-CH2-SW28
Michael
On Oct 25, 2013, at 12:41 PM, Martin Hewitson <email@hidden> wrote:
> Dear list,
>
> I have a view-based tableview. In the row views there are some textfields which are a subclass of NSTextField. Since moving to 10.9, the textfields which are in rows which are out of view when the table loads are rendered all black when those rows are scrolled into view. This is new behaviour. Is this supposed to happen? In other words, did I miss some changes in the release notes which indicate I should do things differently now? Clicking in the offending textfields causes them to then draw properly. The reason I have subclassed NSTextField is because I draw them in different colours depending on the colour of the row background they are embedded in. My drawRect: is below, in case there is something fishy in there that might be causing this.
>
> Any one else seen this behaviour?
>
> Thanks,
>
> Martin
>
>
> - (void)drawRect:(NSRect)dirtyRect
> {
> NSView *superview = [self superview];
> [self setTextColor:[NSColor blackColor]];
> if ([superview respondsToSelector:@selector(startingColor)]) {
> NSColor *c = [superview performSelector:@selector(startingColor)];
> [self setTextColor:[c contrastingLabelColor]];
> [self setDrawsBackground:NO];
> NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:NSInsetRect([self bounds], 0.5, 0.5) xRadius:5.0 yRadius:5.0];
> [[c shadowWithLevel:0.1] set];
> [path stroke];
> if (mouseOver) {
> [[c highlightWithLevel:0.2] set];
> [path fill];
> }
> if ([[self currentEditor] respondsToSelector:@selector(setInsertionPointColor:)]) {
> [[self currentEditor] performSelector:@selector(setInsertionPointColor:) withObject:[c contrastingLabelColor]];
> }
> }
> [super drawRect:dirtyRect];
> }
> _______________________________________________
>
> 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
_______________________________________________
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