Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SquaredTiki/274440 to your computer and use it in GitHub Desktop.
Save SquaredTiki/274440 to your computer and use it in GitHub Desktop.
- (void)outlineView:(NSOutlineView *)outlineView
willDisplayCell:(id)cell
forTableColumn:(NSTableColumn *)tableColumn
item:(id)item {
NSColor *color = [cell backgroundColor];
NSLog(@"Colorizing Method B");
if (clicked == YES) {
if (color == [NSColor lightGrayColor]) {
}else{
[cell setBackgroundColor:[NSColor lightGrayColor]];
clicked = NO;
NSLog(@"Colorizing Method IF 1 END");
}
}else{
if (color == [NSColor lightGrayColor]) {
}else{
[cell setBackgroundColor:[NSColor whiteColor]];
}
NSLog(@"Colorizing Method ELSE END");
}
NSLog(@"Colorizing Method E");
}
- (IBAction)colorize:(id)sender{
NSLog(@"Click Method Begun");
clicked = YES;
int selectedRow = [outlineView selectedRow];
id row = [outlineView itemAtRow:selectedRow];
[outlineView setNeedsDisplayInRect:[outlineView rectOfRow:selectedRow]];
NSLog(@"Click Method Ended");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment