O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSCursor — Mac OS X 10.0

Synopsis

This class represents a mouse cursor on the screen, and is used to create new cursors that can be used in place of the default arrow cursor. NSView objects often define regions within the view in which the cursor is changed when the mouse is present in those regions. For example, in a text view the cursor changes to an I-beam when the cursor is inside of the text field.

image with no caption

@interface NSCursor : NSObject <NSCoding>
                                  // Initializers
   - (id)initWithImage:(NSImage *)newImage 
                                 foregroundColorHint:(NSColor *)fg
                                 backgroundColorHint:(NSColor *)bg 
                                 hotSpot:(NSPoint)hotSpot;
   - (id)initWithImage:(NSImage *)newImage 
                                 hotSpot:(NSPoint)aPoint;
                                  // Accessor Methods
   - (void)setOnMouseEntered:(BOOL)flag;
   - (void)setOnMouseExited:(BOOL)flag;
                                  // Class Methods
   + (NSCursor *)IBeamCursor;
   + (NSCursor *)arrowCursor;
   + (NSCursor *)currentCursor;
   + (void)hide;
   + (void)pop;
   + (void)setHiddenUntilMouseMoves:(BOOL)flag;
   + (void)unhide;
                                  // Instance Methods
   - (void)set;
   - (NSPoint)hotSpot;
   - (NSImage *)image;
   - (BOOL)isSetOnMouseEntered;
   - (BOOL)isSetOnMouseExited;
   - (void)mouseEntered:(NSEvent *)theEvent;
   - (void)mouseExited:(NSEvent *)theEvent;
   - (void)pop;
   - (void)push;
                                  // Methods Implementing NSCoding
   - (void)encodeWithCoder:(NSCoder *)aCoder;
   - (id)initWithCoder:(NSCoder *)aDecoder;

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required