I am trying to change the background color of a window in a NSViewController by using a drop down menu with different color choices. This is the method that should do the changes. What am I doing wrong?
class ViewController: NSViewController, SimplerTextViewDelegate {
@IBAction func changeBackgroundColor(sender: BackgroundColorPopupButton) {
let backgroundColorName= (sender.selectedItem?.title)!
let backgroundColor = BackgroundColor.GetColor(backgroundColorName)
self.view.window!.backgroundColor = backgroundColor
}
}