I have a NSTextFieldCell in a column of a cell-based NSTableView. This cell should handle clicks. This works fine when no modifier keys are pressed. If I hold the shift or command keys, the table view swallows the mouseDown event in an attempt to handle row selection.
Is there a way to completely disable row selection in NSTableView?
Is there a way to have NSTableView pass through all events?
My cell subclass is derived from the LinkTextFieldCell in the TableViewLinks sample code. It implements:
- (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView untilMouseUp:(BOOL)flag
Since I don't want row selection, my table view delegate implements:
- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)rowIndex
{
return NO;
}
- (BOOL)tableView:(NSTableView *)tableView shouldTrackCell:(NSCell *)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
return YES;
}
My delegate methods are called from -[NSTableView mouseDown:]. The mouse tracking code is called when no modifier keys are pressed.
Is there a better way to fix this than subclassing NSTableView to override -[NSTableView mouseDown:]?