Created
June 8, 2011 13:38
-
-
Save Synvox/1014433 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation FileLabel : CPView | |
{ | |
CPTextField text; | |
} | |
- (id) init | |
{ | |
self = [super initWithFrame:CGRectMakeZero()]; | |
text = [[CPTextField alloc] initWithFrame:[self bounds]]; | |
[self addSubview:text]; | |
return self; | |
} | |
- (void)setSelected:(BOOL)isSelected | |
{ | |
[self setBackgroundColor:isSelected ? [CPColor blueColor] : nil]; | |
} | |
- (void)setRepresentedObject:(id)aString | |
{ | |
self = [super initWithFrame:CGRectMakeZero()]; | |
text = [[CPTextField alloc] initWithFrame:[self bounds]]; | |
[self addSubview:text]; | |
[text setStringValue:aString]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment