Re: Need help moving an NSSlider
Re: Need help moving an NSSlider
- Subject: Re: Need help moving an NSSlider
- From: Ryan Bates <email@hidden>
- Date: Sun, 8 Feb 2004 18:42:30 -0800
On Feb 8, 2004, at 4:23 PM, Iain Wood wrote:
I have slider connected to an NSSlider, and window connected to an
NSTextField. A second slider is connected to the setSlider method, and
when I move that slider, a series of values gets sent to the window
NSTextField, but the NSSlider connected to slider doesn't move.
For some reason the NSSlider doesn't like the naming conflict. You need
to rename either the "slider" variable or the "setSlider:" method. I
suggest the method because in normal Cocoa syntax "setSlider:" may be
confused with setting the actual slider instance variable. Remember to
make the changes in both the Nib file and source code. Anyway, after
making that change it will work. Honestly, I have no clue why this
naming conflict would force the slider to not work properly. I know
bindings use these methods, perhaps it has something to do with that.
Anyone have an idea?
Just a couple notes. NSTextField doesn't respond to the "insertText:"
method, perhaps you meant an NSTextView? If you set up the text field
to simply test the results of the slider, you may want to use the
NSLog() function. Such as NSLog(@"Sender Value: %d", [sender
intValue]);
Also using the name "window" as referring to a text view was slightly
confusing. You may want to consider renaming it because it usually
refers to an instance of NSWindow.
Hope that helps.
Ryan
_______________________________________________
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.