title: nsslider.integerValue requires me to focus on another app before updating the value
body: <p>I have an <code>NSSlider</code> in my macos app, called <code>wave_mode_slider</code>. What I'm trying to do is update the value of said slider on input. So, what I did is this:</p>
  
  <pre><code>self.wave_mode_slider?.integerValue = ("\(params[2])" as NSString).integerValue
  </code></pre>
  
  <p>This sets the value of the slider (white dot) to the value of the input as intended. However, before I see any actual result, I have to click outside of the application, which causes the white dot of the slider to jump to it's new value. as shown here:<a href="https://i.stack.imgur.com/aKRFD.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/aKRFD.gif" alt="enter image description here"></a></p>
  
  <p>Is there a way to make the slider update immediately?</p>
  
  <p>My slider is created like this:</p>
  
  <pre><code>    self.wave_mode_slider = NSSlider(frame:CGRect(x: 10, y: 100, width: 20, height: 300))
      self.wave_mode_slider?.cell = OWOWSliderVertical()
      self.wave_mode_slider?.maxValue = 127
      self.wave_mode_slider?.target = self
      self.view?.addSubview(self.wave_mode_slider!)
  </code></pre>
  
  <p>I tried to set the <code>isContinuous</code> property of the slider to true, but that doen't change the outcome.</p>
  
  <hr>
  
  <p>edit:</p>
  
  <pre><code>    var midiClient : MIDIClientRef = 0
      var inPort : MIDIPortRef = 0
      let observer = UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque())
  
          MIDIClientCreate("WobClient" as CFString, nil, nil, &amp;midiClient)
          MIDIInputPortCreate(midiClient, "WobClient_InPort" as CFString, {
              (pktList: UnsafePointer&lt;MIDIPacketList&gt;, readProcRefCon: UnsafeMutableRawPointer?, srcConnRefCon: UnsafeMutableRawPointer?) -&gt; Void in
              let packetList : MIDIPacketList = pktList.pointee
              var packet : MIDIPacket = packetList.packet
              let mySelf = Unmanaged&lt;Wob&gt;.fromOpaque(srcConnRefCon!).takeUnretainedValue()
              for _ in 1...packetList.numPackets {
                  let bytes = Mirror(reflecting: packet.data).children
                  var params : [UInt64] = []
  
                  var i = packet.length
                  for (_, attr) in bytes.enumerated() {
                      let string = String(format: "%02X ", attr.value as! UInt8)
                      params.append(UInt64(strtoul(string, nil, 16)))
                      i -= 1
  
                      if (i &lt;= 0) {
                          break
                      }
                  }
  
  //                print(("\(params[2])" as NSString).integerValue)
                  mySelf.setWaveSliderValue(value: ("\(params[2])" as NSString).integerValue)
                  packet = MIDIPacketNext(&amp;packet).pointee
              }
  
          }, nil, &amp;inPort)
  
          MIDIPortConnectSource(inPort, self.source, observer)
  </code></pre>
  
  <p>This is fro m where i get the value</p>