简体   繁体   中英

disable NSTableView double click

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

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 .

  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

.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM