开发者

disable NSTableView double click

开发者 https://www.devze.com 2023-04-13 09:08 出处:网络
I hope to disable NSTableView row double click and forbid row item edit. Is it possible to disable NSTableView row开发者_开发技巧 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

.

0

精彩评论

暂无评论...
验证码 换一张
取 消