Multiple sliders updating the same text field
Multiple sliders updating the same text field
- Subject: Multiple sliders updating the same text field
- From: Nathaniel Gottlieb-Graham <email@hidden>
- Date: Tue, 24 Jul 2007 11:21:21 -0400
Here's my situation: I have a couple of sliders that both need to
update the same text field. The sliders all send values from -2 to
2, only stopping on integer values (-2, -1, 0, 1, 2). The text field
is supposed to display the combined total of these sliders, so if one
is at -2 and another is at 2, it should display 0. For some reason,
I'm having a lot of trouble with this. Here's the code for one slider:
//this part is elsewhere
religious = 0;
//relevant part
- (IBAction)focusReligionSlider:(id)sender {
startReligious = religious;
currentReligious = religious + [sender intValue];
[factionReligiousTextField setIntValue:startReligious +
currentReligious]
}
This code makes each slider reset the text field's value to the value
of the current slider as soon as it's manipulated, but for the life
of me I can't figure out what to do to fix it.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden