Is there a way to prevent the editing of a table view cell and capture
the action of the user double-clicking it instead? I want the action
of double-clicking the cell to have the same effect as clicking on the
row and clicking a button, but I can't see a way to attach a double
clicked handler to a row, only a table. As it stands, double-clicking
the cell enters it for editing. I want to prevent the editing and
allow the double-clicking to send a double click message. Any
suggestions?
You need to set the particular COLUMN as not editable if you want to
have the double click handler called. See the documentation for
-[NSTableView setDoubleAction:] for more. You can do this either in IB
or in code or finer granularity can be obtained by using the table view
delegate method tableView: shouldEditTableColumn:row:
If the cell is not editable and you double click, the the double click
handler will be called. While, as you note this is attached to the
table not to a row but you can determine where the double click took
place via the sender parameter.