the status of a checkbox in Cocoa
In Interface Builder I made a checkbox and a textbox. When the user checks the checkbox I want a message to appear in the textobx that says "the checkbox is checked." If the box is unchecked I want a message to appear in the textbox that says "the check box is unchecked." The problem is that I don't know how to get the status of the checkbox开发者_开发问答.
Ask the button for its state. If it's NSOnState
, then it's checked. If it's NSOffState
, then it's not checked. If it's NSMixedState
, then it has some children that are checked, and some that are not checked.
精彩评论