NSTableview row-based, not redrawing on 10.9
NSTableview row-based, not redrawing on 10.9
- Subject: NSTableview row-based, not redrawing on 10.9
- From: Martin Hewitson <email@hidden>
- Date: Fri, 25 Oct 2013 20:41:07 +0200
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