added red color to negative counter

This commit is contained in:
Jeena Paradies 2010-05-29 16:53:06 +02:00
parent 1e39bed3f0
commit 797f345b37
2 changed files with 8 additions and 2 deletions

View file

@ -87,7 +87,13 @@
}
-(void)controlTextDidChange:(NSNotification *)aNotification {
[counter setIntValue: 140 - [[textField stringValue] length]];
NSInteger c = 140 - [[textField stringValue] length];
[counter setIntValue:c];
if(c < 0) {
[counter setTextColor:[NSColor redColor]];
} else {
[counter setTextColor:[NSColor controlTextColor]];
}
}