I am looking to make a Application and each row of the table view will have a column with a check box. What i am looking to do is... make the row that the checkbox is on go slightly see through if the check box on that row is checked (this should be implemented on every row of the table as every row has a checkbox) .
views:
201answers:
3How do you make a row in a table view go slighly see through if a checkbox in that row is checked?
Do you really mean "opaque"? ("Slightly opaque" is a lot like "slightly pregnant.")
If you mean change the color, add javascript to the checkbox to change the background of the div containing the checkbox. Here's an example.
I would make a javascript function that changes the style of the row. You could call it when the checkbox is checked.
In your table view delegate, implement this method:
tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
From there you can get the checkbox button cell at the given row, and change the cell's drawing style based on it's state. Keep in mind though that cells are re-used, so you'll have to set the cell style for both checked and unchecked states.
I'm not too clear on what sort of drawing style you're aiming for. Try with a basic NSTextFieldCell first and if you can't accomplish what you're trying to do, create an NSCell subclass and handle the drawing code yourself.