Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable NSTableView double click

Tags:

cocoa

I hope to disable NSTableView row double click and forbid row item edit.

Is it possible to disable NSTableView row double click?

Welcome any comment

like image 261
monsabre Avatar asked Oct 15 '11 05:10

monsabre


2 Answers

Try including this method and return NO:

- (BOOL)tableView:(NSTableView *)aTableView
shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex {
    return NO;
}

Also check out the documentation for NSTableView.

like image 144
sudo rm -rf Avatar answered Sep 24 '22 20:09

sudo rm -rf


  1. You can use Tableview delegate method `tableView:shouldEditTableColumn:row
  2. Or you can also disable this from Interface builder
  3. or you can also overwrite mouse click event of tableview

.

like image 34
Parag Bafna Avatar answered Sep 23 '22 20:09

Parag Bafna