Re: How to uncheck checkbox in an NSTableView
Re: How to uncheck checkbox in an NSTableView
- Subject: Re: How to uncheck checkbox in an NSTableView
- From: Quincey Morris <email@hidden>
- Date: Wed, 23 Dec 2009 12:59:55 -0800
On Dec 23, 2009, at 02:05, Lance Kwan wrote:
> I have troubles on unchecking a checkbox in a table view.
What troubles? We can't help if we don't know.
> if([buttonCell state] == 1)
Why are you using 0 and 1 for your 'if' tests, instead of NSOffState and NSOnState?
> {
> NSLog(@"checkbox is check. Need to uncheck 1");
> NSLog(@"current state %d",[buttonCell state]);
> [buttonCell setState:NSOffState];
> [buttonCell setNextState];
This code turns the checkbox off (setState:NSOffState) and then turns it back on again (setNextState). Seems like a bug.
> NSLog(@"new state %d",[buttonCell state]);
>
> }
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden