Re: return NO in tableViewSelectionDidChange: disables button cell
Re: return NO in tableViewSelectionDidChange: disables button cell
- Subject: Re: return NO in tableViewSelectionDidChange: disables button cell
- From: Quincey Morris <email@hidden>
- Date: Sat, 08 Oct 2011 20:20:51 -0700
On Oct 8, 2011, at 20:10 , Michael Hanna wrote:
> On Mac OS X 10.6.8, in an NSTableView I have a column that contains
> nsbuttoncell class. Row selection isn't useful in my application but doing:
>
> - (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)row
> {
> return NO;
> }
>
> means that there is no response whenever I click on the button cell(it
> doesn't fire).
>
> How do I get that button cell to send it's action and have no row selection
> in the table view at the same time? I'm sure there is a way to do this.
See the 'tableView:shouldTrackCell:forTableColumn:row:' delegate method.
The reference documentation for this method includes this discussion:
> "Normally, only selectable or selected cells can be tracked. If you implement this method, cells which are not selectable or selected can be tracked, and vice-versa.
>
> "For example, this allows you to have an NSButtonCell in a table which does not change the selection, but can still be clicked on and tracked."
Does that sound relevant to your situation?
_______________________________________________
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