开发者

how to change NSCursor and effect on my application

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜