双击Cocoa中的NSTableView行? [英] Double click an NSTableView row in Cocoa?

查看:229
本文介绍了双击Cocoa中的NSTableView行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户双击 NSTableView 中的一行时,我需要我的应用程序打开一个窗口。我有一个困难的时候找到信息或例子如何完成这一点。任何人都可以指向正确的方向?

I need my application to open a window when a user double clicks on a row in an NSTableView. I'm having a bit of a difficult time finding information or examples on how to accomplish this. Can anybody point me in the right direction?

推荐答案

查看 -setDoubleAction: 方法在NSTableView;您可以将其设置为将像正常的目标操作系统一样调用的方法,但是双击。

Take a look at the -setDoubleAction: method on NSTableView; you can set that to a method that will be called just like the normal target-action system but on a double-click.

在该操作方法中, -clickedRow 会很有用。

In that action method, -clickedRow will be useful.

这篇关于双击Cocoa中的NSTableView行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆