0

I want to extend NSSlider class to have an output textfield appended to it. In regards to this I wonder if:

  1. my approach of wanting to append a textfield to NSSlider class is completely wrong and against MVC pattern;
  2. if it is not wrong how should I achieve this? Should I possibly extend NSSlider class with a Category?

Thank you in advance

yacana
  • 144
  • 2
  • 10
  • 2
    What exactly do you want? Are you trying to put a NSTextField next to an NSSlider, and have the NSTextField show the slider's value? Do you want to have an NSSlider inside an NSTextField? – Michael Buckley May 04 '12 at 20:33

1 Answers1

2

I wouldn't say that your approach is completely wrong, but it'd probably be easier to create a view (or perhaps a control) that contains both a slider and a text field.

It doesn't sound like you want to change the way the slider displays itself -- you just want a text field next to the slider, and for the value in the field to be tied to the position of the slider, right? If so, composition is the way to go.

Caleb
  • 124,013
  • 19
  • 183
  • 272