Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

the status of a checkbox in Cocoa

Tags:

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.

like image 553
neuromancer Avatar asked Jul 08 '10 00:07

neuromancer


1 Answers

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.

like image 182
Chuck Avatar answered Nov 20 '22 17:11

Chuck