Re: Reading value of a checkbox in an NSTable
Re: Reading value of a checkbox in an NSTable
- Subject: Re: Reading value of a checkbox in an NSTable
- From: Greg Robbins <email@hidden>
- Date: Tue, 22 Jun 2004 12:50:26 -0700
At 2:49 PM -0400 6/22/04, Mike O'Connor wrote:
I've got an NSTable with a few columns, and in one column I've
placed an NSButtonCell there with IB. This cell is set to be a
checkbox. When the user clicks a checkbox, I want to call an
IBAction so I can read the new state and set some data appropriately.
There's only one button used for all rows of the table's column, so
it's not appropriate to treat it as if there were different instances
of the button for each row.
Instead of relying on an action for the button, just handle clicks to
it in the data source's setObjectValue method,
- (void)tableView:(NSTableView *)aTableView
setObjectValue:(id)theValue
forTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex;
where theValue will tell you the new setting for the checkbox after
the user clicks it.
Greg Robbins
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.