如何刷新/失效 NSCursor?
当我在自定义视图上使用 ResetCursorRects 更新光标矩形时,只要用户移出矩形然后再返回,它就会正确更新光标。有没有一种方法可以让 NSCursor 刷新而无需用户鼠标移出然后返回?
When I update my cursor rect with resetCursorRects on my custom view, it correctly updates the cursor, as long as the user moves out of the rect, then back in. Is there a way where I can get the NSCursor to refresh without the user having to mouse out and back in?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想调用
NSWindow
的invalidateCursorRectsForView:
方法。
You probably want to call your
NSWindow
'sinvalidateCursorRectsForView:
method.