I've got a view and I'd like to add a check box to it under program control (no .xib file). Here is the code I'm trying, but I get no checkbox on the screen (it does draw everything else just fine in the view). Am I missing something?
Early in the class:
var rodLimitsCB : NSButton?
inside viewWillMoveToWindow:
if showRodLimits && rodLimitsCB == nil {
rodLimitsCB = NSButton(frame: NSRect(x: self.frame.origin.x+100, y: self.frame.origin.x+100, width: 30, height: 30))
rodLimitsCB!.setButtonType( .SwitchButton )
rodLimitsCB!.title = "Rod Limits"
self.addSubview( rodLimitsCB! )
}
Any pointers would be appreciated.