开发者

how to change NSCursor and effect on my application

开发者 https://www.devze.com 2022-12-25 03:01 出处:网络
I have obtained the crosshair cursor from NSCursor crosshairCursor. Then, how can i change to it. I don\'t want to call enclosingScrollView to setDoc开发者_运维技巧umentCursor as

I have obtained the crosshair cursor from NSCursor crosshairCursor. Then, how can i change

to it. I don't want to call enclosingScrollView to setDoc开发者_运维技巧umentCursor as

[[view enclosingScrollView] setDocumentCursor:crosshaircursor ];


You just use the -set method of NSCursor to set the current cursor:

[[NSCursor crosshairCursor] set];


You can implement a resetCursorRects method to send yourself addCursorRect:cursor: mesasges. This way, the cursor will automatically change to the crosshair whenever it enters the appointed section of your view.

0

精彩评论

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

关注公众号