Re: Visually disabling some checkboxes in a NSTableView
Re: Visually disabling some checkboxes in a NSTableView
- Subject: Re: Visually disabling some checkboxes in a NSTableView
- From: Kyle Sluder <email@hidden>
- Date: Sat, 21 May 2011 10:02:29 -0700
On Sat, May 21, 2011 at 9:19 AM, Tito Ciuro <email@hidden> wrote:
> Hello,
>
> I have a table view which contains a column that displays checkboxes. I would like to disable and gray out some of the checkboxes, so I guess there are two possible ways (perhaps there's another way?):
>
> 1) disable the control (i.e. gray out) so that the user cannot toggle it (in one single method)
There is no checkbox control. The tableview uses one checkbox cell to
draw the entire column. So you can't just selectively disable checkbox
instances because there is only one checkbox.
Disable the cell in -tableView:willDisplayCell:forTableColumn:row:.
Alternatively, if you're using bindings, bind the table column's
"enabled" binding to a key that returns YES or NO as appropriate.
--Kyle Sluder
_______________________________________________
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