Search code examples
objective-cmacoscocoaosx-lionnscursor

Native OSX Lion resize cursor for custom NSWindow or NSView


If we use NSTrackingArea for some specified region then we can implement such method to change the default cursor:

-(void)cursorUpdate:(NSEvent *)theEvent {
    [[NSCursor resizeLeftCursor] set];
}

I implementing custom resize for NSWindow, which uses NSBorderlessWindowMask. And want to use native Lion's two arrows cursors. But such type of cursors not exist in NSCursor API.

Can I get such native cursors somehow from code?
Or maybe I must redraw them by hand (not a good idea)?


Solution

  • WebKit contains images that look exactly the same as the cursors used by the system, in the following directory:

    /System/Library/Frameworks/WebKit.framework/Versions/Current/Frameworks/WebCore.framework/Resources/
    

    ...for example, the file "northWestSouthEastResizeCursor.png".