NSTextFields and corresponding sliders
NSTextFields and corresponding sliders
- Subject: NSTextFields and corresponding sliders
- From: Marten van Gelderen <email@hidden>
- Date: Sat, 14 Feb 2004 18:54:38 +0100
Hello,
I have an app with some ten numerical input text-fields all with
corresponding sliders. Using -takeFloatValueFrom: they properly react
on each other's changes. Using: -(BOOL)control:(NSControl *)control
textShouldEndEditing:(NSText *)textObject I check for validity of
entries in the textFields. I use a (long) switch on the tag of the
"control" to differentiate between the possible ten fields and when a
value is outside the corresponding slider's range, I present an alert.
The "textShouldEndEditing" message gives me the "control" which is the
textField, but does not provide me with (the name of) the corresponding
slider. Do I oversee an easy way to "couple" my textFields (which are
instance variables in my Preferences class) to their corresponding
sliders (which are also instance variables in my Preferences class)?
The switch is fast enough, that is not the problem, but it seems a lot
(hard to maintain) code.
Any suggestion (positive or not) is greatly appreciated
--
Groeten, Marten
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.