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
3
votes
1 answer

Detect mouseUp event from NSSlider in Swift 4 / MacOS

I'm pretty new to Swift, so please have mercy on me. I have a function that I want to call when the user has finished sliding an NSSlider object. My natural thought is to use the mouseUp event. However, lots of Googling and reading documentation has…
MCP_User
  • 79
  • 6
3
votes
1 answer

Increment NSSlider by 0.1? macOS, Swift

I have a NSSlider where the minimum is 0.6 and maximum is 1. I want to be able to increment by 0.1 and not have values such as 0.6493 or 0.8435 How would I accomplish this? I have the function @IBAction func slider(sender : NSSlider) { var x:…
user10559318
3
votes
1 answer

Update the value of an NSSlider in realtime

In my swift 3 app, I have an NSSlider that I created like this: self.myAwesomeSlider = NSSlider(frame:CGRect(x: 10, y: 100, width: 20, height: 300)) self.myAwesomeSlider?.cell = NSSlider() self.myAwesomeSlider?.maxValue =…
Wesley
  • 205
  • 1
  • 2
  • 11
3
votes
2 answers

Making a circular NSSlide look and behave like in GarageBand

I am new to drawing with Cocoa, and I am making some software which will have sliders similar to these found in GarageBand: GB Sliders http://img33.imageshack.us/img33/2668/schermafbeelding2010061r.png These look beautiful and can be controld by…
user142019
3
votes
1 answer

Is it possible to label the tick marks on an NSSlider

I have some vertical sliders and I want to be able to label the tick marks with the values they represent. Is there a better way to do this besides manually putting labels next to them in the Interface Builder? If not, is there a way to at least…
nonex
  • 233
  • 3
  • 12
3
votes
1 answer

How to customize a NSSlider

I'm trying to implement a custom slider in Cocoa with 5 values. See my demo project, which can be downloaded here: http://s000.tinyupload.com/index.php?file_id=07311576247413689572. I've subclassed the NSSliderCell and implemented methods like…
dhrm
  • 14,335
  • 34
  • 117
  • 183
3
votes
2 answers

Invoke NSControl's "valueChanged" when changing values programmatically

I am about to implement a simple audio fader. I subclassed NSSlider and NSSliderCell to be able to draw the graphics accordingly. I want the slider to jump to a defined position whenever the handle is clicked with the Cmd key pressed. This is pretty…
guitarflow
  • 2,930
  • 25
  • 38
2
votes
0 answers

How can I set a tooltip to display while dragging an NSSlider?

I've got an NSSlider. I've set it to update continuously. In my update code I have: [quality setToolTip:qualityTooltips[pos]]; This updates the tooltip, but the tooltip is not displayed while I'm dragging the slider. In fact it vanishes as soon…
fredley
  • 32,953
  • 42
  • 145
  • 236
2
votes
1 answer

Controlling master volume on Mac through a Cocoa application

I am looking to incorporate a NSSlider in a Cocoa application that controls the master volume of a Mac. I do not want to do this through AppleScript though, even though I know it is probably easier. I found this code that should be able to do the…
Stevezie
  • 111
  • 2
  • 11
2
votes
3 answers

Hiding NSSlider's tick marks

Is there a way to hide the tick marks of NSSlider?
user635064
  • 6,219
  • 12
  • 54
  • 100
2
votes
2 answers

Scaling does not work for NSSlider in MacOS

I have a NSSlider and I'm trying to scale it with the code: let circle = NSSlider(frame: NSRect(x: 0.0, y: 333.0, width: 50.0, height: 50.0)) circle.layer?.setAffineTransform(CGAffineTransform(scaleX: 20.0, y: 20.0)) circle.wantsLayer =…
J. Doe
  • 521
  • 4
  • 15
2
votes
0 answers

osx nsslider call function while changing

i working with swift 3 for osx and i have a pdf view like this: @IBOutlet weak var pdfView: PDFView! let dictDocuments = NSURL(fileURLWithPath: NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]) let completePath =…
Trombone0904
  • 4,132
  • 8
  • 51
  • 104
2
votes
1 answer

NSSlider with non-linear scale

I'm trying to make an NSSlider's values/digits non-linear... @IBOutlet private weak var _countSlider:NSSlider!; let countSliderValues:[Int] = [1, 20, 50, 100, 500, 1000]; _countSlider.numberOfTickMarks =…
BadmintonCat
  • 9,416
  • 14
  • 78
  • 129
2
votes
0 answers

Customizing NSSliderCell

I want to customize NSSliderCell, but I'm getting strange glitch. Here is what it should looks like (zoomed): It draws ok, but when I'm drugging the knob, left bar starts look weird (looks like part of knob's shadow is left from previous…
Denis Kildishev
  • 709
  • 2
  • 7
  • 15
2
votes
1 answer

NSSlider custom knob image

I tried searching the internet for good tips to draw a custom Image with a different size for the knob of a NSSlider. I hope we can gather the ideas this time in one place. The problem most people get is that they want a different size knob,…
bennibeef
  • 105
  • 2
  • 9