- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我对 NSControl 进行了子类化以获得自定义控件, 对 NSCell 进行子类化以获得我的自定义单元格, 重写 -(BOOL)trackMouse:inRect:ofView:untilMouseUp
和必要的方法 在自定义单元格中, 已覆盖 customControl 中的 + (Class)cellClass
以返回我的 customCell,
单元格在控件上绘制良好,设置启用、设置禁用效果很好,但是 鼠标事件没有被触发。 在调试时我注意到 -(BOOL)trackMouse:inRect:ofView:untilMouseUp:
从未被调用。根据“控制和单元编程指南”-
"Controls manage the behavior of their cells. By inheritance from NSView, controls derive the ability for responding to user actions and rendering their on-screen representation. When users click on a control, it responds in part by sending
trackMouse:inRect:ofView:untilMouseUp:
to the cell that was clicked"
请告诉我是否遗漏了一些东西 - 我在谷歌上搜索了很多,但没有找到任何有用的东西。
最佳答案
关于objective-c - -(BOOL)trackMouse :inRect:ofView:untilMouseUp: Is never invoked,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16708801/
我是一名优秀的程序员,十分优秀!