Fixed Mac OS X Spinbox.SetValue(). Stupid bug =p

This commit is contained in:
Pietro Gagliardi 2014-10-31 16:07:14 -04:00
parent 4a98fdb907
commit 68af61435e
1 changed files with 1 additions and 4 deletions

View File

@ -58,12 +58,11 @@
- (void)setValue:(NSInteger)value - (void)setValue:(NSInteger)value
{ {
self->value = value;
if (self->value < self->minimum) if (self->value < self->minimum)
self->value = self->minimum; self->value = self->minimum;
if (self->value > self->maximum) if (self->value > self->maximum)
self->value = self->maximum; self->value = self->maximum;
self->value = value;
// TODO does not work?
[self->textfield setIntegerValue:self->value]; [self->textfield setIntegerValue:self->value];
[self->stepper setIntegerValue:self->value]; [self->stepper setIntegerValue:self->value];
} }
@ -84,13 +83,11 @@
- (IBAction)stepperClicked:(id)sender - (IBAction)stepperClicked:(id)sender
{ {
NSLog(@"stepperClicked %d\n", [self->stepper integerValue]);
[self setValue:[self->stepper integerValue]]; [self setValue:[self->stepper integerValue]];
} }
- (void)controlTextDidChange:(NSNotification *)note - (void)controlTextDidChange:(NSNotification *)note
{ {
NSLog(@"controlTextDidChange %d\n", [self->textfield integerValue]);
[self setValue:[self->textfield integerValue]]; [self setValue:[self->textfield integerValue]];
} }