Hey guys, I've been wrestling with this problem for a while now, and I can't seem to come up with a solution. I've got a subclassed TableView that has a special column for drawing circles, based on the color assigned to the "parent data" of the table. (See Pic 1 for details.)
The problem is, when I switch over to a different parent, like to the blue subject, any tasks I add will have the same peach color, *until* I exceed the number of earlier-created subjects. Confusing I know, but here's an example:
I've got the situation seen below. I switch over to the blue subject, and create a task. It's peach. Create a second, it's still peach. Create a third, however, and they all turn blue. When I go back to the peach subject after creating that third blue task, The original two peach-colored "Thing 1" and "Thing 2" objects have turned blue as well!
Here's what I'm using, in a subclassed NSTextFieldCell:
I'm assuming there's something wrong with the way I'm drawing the circle, but I'm not that familiar with custom graphics. Here's to hoping you guys know a bit more than me! As always, thanks so much for your help!
The problem is, when I switch over to a different parent, like to the blue subject, any tasks I add will have the same peach color, *until* I exceed the number of earlier-created subjects. Confusing I know, but here's an example:
I've got the situation seen below. I switch over to the blue subject, and create a task. It's peach. Create a second, it's still peach. Create a third, however, and they all turn blue. When I go back to the peach subject after creating that third blue task, The original two peach-colored "Thing 1" and "Thing 2" objects have turned blue as well!
Here's what I'm using, in a subclassed NSTextFieldCell:
Code:
NSColor *taskParentColor = [NSUnarchiver unarchiveObjectWithData:[[currentObject valueForKey:@"parentSubject"] valueForKey:@"color"]];
[taskParentColor set];
NSBezierPath* thePath3 = [NSBezierPath bezierPath];
NSRect bounds3 = NSMakeRect(cellFrame.origin.x + (cellFrame.size.width / 2) - 5, cellFrame.origin.y + 3, 10, 10);
[thePath3 appendBezierPathWithOvalInRect:bounds3];
[thePath3 fill];
I'm assuming there's something wrong with the way I'm drawing the circle, but I'm not that familiar with custom graphics. Here's to hoping you guys know a bit more than me! As always, thanks so much for your help!