One Quickie


Setting a cursor for a view (NSView->General)
Sometimes you want to change the cursor for a view, say with a crosshair for a view that lets you select a rectangle out of an image. There is no -[NSView setCursor:] call (drat!) You can get something similar by adding this to your NSView subclass:
- (void) resetCursorRects
{
    [super resetCursorRects];
    [self addCursorRect: [self bounds]
          cursor: [NSCursor crosshairCursor]];

} // resetCursorRects



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com