 //TODO		self.scrollbar.arrowsPosition = NSScrollArrowPosition.ScrollerArrowsDefaultSetting
 		self.scrollbar.translatesAutoresizingMaskIntoConstraints = false
 
-		self.doubleValue = newLabel("")
+		self.info = newLabel("")
 
 		contentView.addSubview(container1)
 		contentView.addSubview(self.scrollbar)
-		contentView.addSubview(self.doubleValue)
+		contentView.addSubview(self.info)
 		views = [
-			"container1":		container1,
-			"scrollbar":		scrollbar,
-			"doubleValue":		doubleValue,
+			"container1":	container1,
+			"scrollbar":	self.scrollbar,
+			"info":		self.info,
 		]
-		addConstraint(contentView, "V:|-[container1]-[scrollbar]-[doubleValue]-|", views)
+		addConstraint(contentView, "V:|-[container1]-[scrollbar]-[info]-|", views)
 		addConstraint(contentView, "H:|-[container1]-|", views)
 		addConstraint(contentView, "H:|-[scrollbar]-|", views)
-		addConstraint(contentView, "H:|-[doubleValue]-|", views)
+		addConstraint(contentView, "H:|-[info]-|", views)
 
 		self.nhformatter = newNumberFormatter(0, 100000)
 


	private var scrollbar: NSScroller

	private var proportion: NSTextField
	private var doubleValue: NSTextField

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

		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) {
		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() {
		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
	}
}

