开发者

Cursor in NSTextView

I have a scroll view, and a number of custom views (same class) inside it. Each custom view contains an NSTextView. I want the cursor to stay as arrow all the time, because the text views are not editable. However, setting the cursor using attributed string only controls the areas where there are characters. So I tried to override the mouseMoved method of the scroll view. This does the trick but when I scroll the view by triggering the scrollWheel event, the cursor changed back to IBeam again.

An开发者_Python百科y idea how to solve this problem?

Thanks


Have you tried just calling

[textView setSelectable:NO];

to force the arrow cursor to be used (assuming the textView is also not editable via -setEditable:)?

Otherwise, you might look into the following: Managing Cursor-Update Events.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜