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.
精彩评论