如何刷新/失效 NSCursor?

发布于 2024-12-25 07:24:06 字数 104 浏览 2 评论 0原文

当我在自定义视图上使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丢了幸福的猪 2025-01-01 07:24:06

您可能想调用 NSWindow

invalidateCursorRectsForView:

方法。

You probably want to call your NSWindow's

invalidateCursorRectsForView:

method.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文