Skip to content

Instantly share code, notes, and snippets.

@orlaqp
Created March 31, 2011 14:35
Show Gist options
  • Save orlaqp/896456 to your computer and use it in GitHub Desktop.
Save orlaqp/896456 to your computer and use it in GitHub Desktop.
@import <AppKit/CPButton.j>
@implementation AnchorLink : CPButton
{
}
- (void)setObjectvalue:(id)anObjectValue
{
debugger;
if (!anObjectValue || anObjectValue === @"")
{
[self setTitle:@"N/A"];
}
else
{
[self setTitle:[anObjectValue stringValue]];
}
[super setObjectValue:anObjectValue];
}
@end
-- Table Code, here is where I add the column
var linkButton = [[AnchorLink alloc] initWithFrame:CGRectMake(0,0,100,28)];
[linkButton setBordered:NO];
[linkButton setTextColor:[CPColor blueColor]];
[linkButton setTitle:@"Open report in new page"];
var linkColumn = [[CPTableColumn alloc] initWithIdentifier:@"links"];
[[linkColumn headerView] setStringValue:"Link"];
[linkColumn setMaxWidth:500.0];
[linkColumn setWidth:200.0];
[linkColumn setDataView:linkButton];
[_tableView addTableColumn:linkColumn];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment