 		self.updateLabels()
 	}
 
+	func lineincr() -> CGFloat {
+		var swidth = self.scrollbar.frame.width
+		var max = CGFloat(self.nhspinb.integerValue) - swidth
+		if max <= 0 {
+			return 0
+		}
+		return 1.0 / max
+	}
+
+	func pageincr() -> CGFloat {
+		return self.lineincr() * self.scrollbar.frame.width
+	}
+
 	@IBAction func onScroll(sender: AnyObject) {
-		println("got \(self.scrollbar.hitPart)")
+		switch self.scrollbar.hitPart {
+		case NSScrollerPart.NoPart:
+			// do nothing
+			break
+		case NSScrollerPart.DecrementPage:
+			self.scrollbar.doubleValue -= Double(self.pageincr())
+		case NSScrollerPart.Knob:
+			// do nothing
+			break
+		case NSScrollerPart.IncrementPage:
+			self.scrollbar.doubleValue += Double(self.pageincr())
+		case NSScrollerPart.DecrementLine:
+			self.scrollbar.doubleValue -= Double(self.lineincr())
+		case NSScrollerPart.IncrementLine:
+			self.scrollbar.doubleValue += Double(self.lineincr())
+		case NSScrollerPart.KnobSlot:
+			// do nothing
+			break
+		}
 		self.updateLabels()
 	}
 
 	func updateLabels() {
-		self.proportion.stringValue = "Proportion: \(self.scrollbar.knobProportion)"
-		self.doubleValue.stringValue = "Double Value: \(self.scrollbar.doubleValue)"
+		var swidth = self.scrollbar.frame.width
+		var max = CGFloat(self.nhspinb.integerValue) - swidth
+		if max < 0 {
+			max = 0
+		}
+		var infostr = "Width: \(swidth)"
+		infostr += "\nProportion: \(self.scrollbar.knobProportion)"
+		infostr += "\nDouble Value: \(self.scrollbar.doubleValue)"
+		var scaledValue = Int(self.scrollbar.doubleValue * Double(max))
+		infostr += "\nScaled: \(scaledValue)"
+		var lineincr: CGFloat = 0
+		if max != 0 {
+			lineincr = 1.0 / max
+		}
+		infostr += "\nLine Increment: \(lineincr)"
+		infostr += "\nPage Increment: \(lineincr * swidth)"
+		self.info.stringValue = infostr
 	}
 }
 

	cell.lineBreakMode = NSLineBreakMode.ByClipping
	cell.scrollable = true
	tf.translatesAutoresizingMaskIntoConstraints = false
	tf.setContentHuggingPriority(1000, forOrientation: NSLayoutConstraintOrientation.Horizontal)
	tf.setContentCompressionResistancePriority(1000, forOrientation: NSLayoutConstraintOrientation.Vertical)
	return tf
}


	private var scrollbar: NSScroller

	private var info: NSTextField

	init(_ contentView: NSView) {
		var views: [String: NSView]
