Questions tagged [nsslider]

NSSlider object belongs to Apple's class it displays a range of values. NSSlider can be used for volume control, colors selection, brightness adjust, etc.. It has continous and discrete modes.

An NSSlider object displays a range of values for something in the application. Sliders can be vertical or horizontal bars or circular dials. An indicator, or knob, notes the current setting. The user can move the knob in the slider’s bar—or rotate the knob in a circular slider to change the setting.

The NSSlider class uses the NSSliderCell class to implement its user interface.

NSSlider Class Reference.

85 questions
1
vote
1 answer

How to adjust brightness with NSSlider for NSImage class via Swift?

I need to control a transparency (or opacity) of my uploaded images (JPEG, PNG, TIFF, etc) with NSSlider. How I can do it? Here is a code written in AppDelegate.swift @IBAction func importButton(sender: AnyObject) { let uploadFile: NSOpenPanel…
Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
1
vote
1 answer

Swift: How to continuously send an action from a NSTextField

I have a NSTextField and want to send an action whenever the user changes the value. I checked "Continuous" in the Interface Builder (which works i.e. fine with NSSlider), but the NSTextField only sends his action if I unfocus it. How can I…
ixany
  • 5,433
  • 9
  • 41
  • 65
1
vote
2 answers

Can't set NSSlider value in applicationDidFinishLaunching

I need to set a slider in preferences window of a cocoa application. If I set the NSSlider in awakeFromNib like so -(void)awakeFromNib{ [thresholdSlider setInValue:9]; } the preference window updates with the value when opened. Though, since…
1
vote
1 answer

Add "%" to a constantly changing string

I have a NSSlider and an NSLabel. When the slider's value changes it changes the label's text to the new value. My problem is that I want to a "%" at the end, but whenever I try to change my code, error occurs. Here's my code: int sliderValue =…
Lae
  • 832
  • 1
  • 13
  • 34
1
vote
0 answers

What is correct way to create a NSSlider with two thumbs(knobs)

I need to specify a range let's say the minvalue is 0 maxvalue is 100 thumb1 value can range from minvalue to thumb1 value thumb2 value can range from thumb1 value to maxvalue Basically they should not overlap. Is there any other solution other…
user226372
  • 165
  • 1
  • 9
1
vote
1 answer

NSSliderCell: subclass to draw custom knob

I need to subclass NSSliderCell to customise its appearance. I had no problem with the bar, I overrode - (void)drawBarInside:(NSRect)aRect flipped:(BOOL)flipped and it works as expected. - (void)drawKnob:(NSRect)knobRect works as well, but I want…
Alessandro
  • 61
  • 1
  • 8
1
vote
1 answer

Using multiple NSSliderCell in a single NSSlider

I'd like to create an NSSlider that has three knobs, not just one. I'm thinking I can subclass NSSliderCell and then override the tracking methods to ensure that one slider cell doesn't pass the one next to it. That's easy enough to do, but I'm…
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
1
vote
1 answer

How to connect an NSControl to an Action *and* a label in IB?

I'm trying to connect an NSSlider to both a label (takeIntValueFrom) to show its value, and an IBAction in my .xib. However, connecting either one of them un-connects the other. I could do this programmatically, but I'd like to know if there's a…
Joey FourSheds
  • 479
  • 1
  • 7
  • 18
1
vote
1 answer

Automatilcally transform slider value

I have a slider, bind it with text field. It is possible automatically transform value to this format: Example 01 02 03 04 05 06 .. 13 14 15 ..? Thanks!
Nikolai Nagornyi
  • 1,312
  • 2
  • 11
  • 26
1
vote
1 answer

NSSlider popover

I have a custom NSSlider. Because of lacking space I want to show the value of it only when the user hovers over the slider. Just like this one: http://dribbble.com/shots/754412-Range-Selection I know how the hover part works, using…
IluTov
  • 6,807
  • 6
  • 41
  • 103
1
vote
0 answers

Programmatic start NSSlider dragging

I would like to start a slider action programmatically. So pressing on some text in a NSTextView that displays a slider also automatically starts the mousedown event on the slider so you can drag immediately instead of pressing twice. What approach…
Jonas Jongejan
  • 2,826
  • 1
  • 16
  • 17
1
vote
2 answers

How to colorize the portion left of the knob on a NSSlider

In my project an NSSlider controls the volume of a AVPlayer. I'd like to colorize the portion of the NSSlider left of the knob. How can this be achieved?
murze
  • 4,015
  • 8
  • 43
  • 70
1
vote
0 answers

App specific volume

Is there any way to change the app volume using a NSSlider? I would like to change the volume for the current app only, but not the system volume.
0
votes
1 answer

Cocoa: how to reference lots of NSSliders

I have this xib file for my main window, and it contains 64 sliders to be able to create a matrix mix for an audio application. Setting the values using the sliders works, but I also want to save the values to the default preferences and load them…
0
votes
1 answer

"Freeze" the slider

Is it possible to "freeze" the slider (NSSlider)? I'd like to make my slider unmovable (with a fixed value) when I press the button "Start", which starts my application... And when I press the button "Stop", which terminates my apllication, I'd like…
Damijan
  • 183
  • 1
  • 2
  • 7