NSTableView:右键单击的行上的蓝色轮廓 [英] NSTableView: blue outline on right-clicked rows

查看:535
本文介绍了NSTableView:右键单击的行上的蓝色轮廓的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想知道如何去除Cocoa在NSTableView / NSOutlineView中右键点击时绘制的蓝色轮廓。


I'm wondering how I can get rid of the blue outlines that Cocoa draws around rows in NSTableView / NSOutlineView when right-clicking on them.

如果我没有错误,它似乎不是一个经典的亮点或聚焦环 - 所以,它是什么?

It doesn't seem to be a classic "highlight" nor a "focus ring" if I'm not mistaken - so, what is it, actually?

我目前正在绘制自定义NSCells,但我不知道如何

*自己绘制这个轮廓,或

*摆脱它,或

*至少改变它的颜色

I'm currently drawing custom NSCells completely myself - but I can't figure out how to either
* draw this outline by myself, too, or
* get rid of it, or
* at least change its colour

任何提示都是非常欢迎!谢谢!

Any hints are very welcome! Thanks!

推荐答案

不幸的是,我不知道有任何文档化的方式来做到这一点,

Unfortunately I'm not aware of any documented way to do this, short of writing your own table view replacement.

覆写的方法是:

- (void)drawContextMenuHighlightForRow:(NSInteger)row;

请向Apple提交增强请求,以便您不必依赖无证的方法你想在将来。它看起来像另外两个表视图高亮方法在10.6中可以自定义,但这一个不是。我一直认为这是一个有点笨拙的看,但有必要指出菜单引用的行(不一定与突出显示的行)。

Please file an enhancement request with Apple so you won't have to rely on undocumented methods to do what you want in future. It looks like the other two table view highlight methods were made customizable in 10.6 but this one wasn't. I've always thought it was a bit clunky looking but it's necessary to indicate what row the menu is referencing (not necessarily the same as the highlighted row).

这篇关于NSTableView:右键单击的行上的蓝色轮廓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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