ftp.nice.ch/peanuts/GeneralData/Documents/openstep/OpenStepSpec_rtf.tar.gz#/OpenStepSpec_rtf/ApplicationKit/Classes/NSCursor.rtf

This is NSCursor.rtf in view mode; [Download] [Up]

paperh18648 margl-907 margr0 margt0 margb0 fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1994 by NeXT Computer, Inc.  All Rights Reserved.

s4 li100 fi0 ri1007 ql f0 b fs36 fs100 
fs36 NSCursor
pard s14 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 
fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSObject
fs20 
fs28 s7 f0 b fs24 Conforms To:tab b0 fs28 f1 NSCoding
fi0 NSObject (NSObject)
fs20 
fs28 s14 fi-2771 fs20 
fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 AppKit/NSCursor.h
fs20 
fs28 pard s19 li100 fi0 ri1007 ql f0 b fs28 fs20 
fs28 Class Description
fs14 
fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 
fs28 An NSCursor holds an image that the window system can display for the cursor. An NSCursor is initialized with an NSImage object (which can subsequently be replaced by sending the NSCursor a b setImage:b0  message). To make the window system display a particular image as the current cursor, simply send a b setb0  message to the NSCursor instance associated with that image. 
fs16 
fs28 For automatic cursor management, an NSCursor can be assigned to a cursor rectangle within a window. When the window is key and the user moves the cursor into the rectangle, the NSCursor becomes the current cursor. It ceases to be the current cursor when the cursor leaves the rectangle. The assignment is made using NSView'27s b addCursorRect:cursor:b0  method, usually inside a b resetCursorRectsb0  method:
fs16 
fs28 pard s6 li1231 fi0 ri1007 ql f2 fs20 - (void)resetCursorRects
{
    [self addCursorRect:someRect cursor:theNSCursorObject];
}
pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 fs28 fs16 
fs28 This is the recommended way of associating a cursor with a particular region inside a window. However, the NSCursor class provides two other ways of setting the cursor:
fs16 
fs28 pard s3 li1231 fi-376 ri1007 ql tx1231 tx2872 tx3250 'b7tab The class maintains its own stack of cursors. Pushing an NSCursor instance on the stack sets it to be the current cursor. Popping an NSCursor from the stack sets the next NSCursor in line, the one that'27s then at the top of the stack, to be the current cursor.
fs16 
fs28 'b7tab An NSCursor can be made the owner of a tracking rectangle and told to set itself when it receives a mouse-entered or mouse-exited event.
fs16 
fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 The Application Kit provides two ready-made NSCursor instances: the standard arrow cursor, and the I-beam cursor that'27s displayed over editable or selectable text. These can be retrieved with the class methods b arrowCursorb0  and b IBeamCursorb0 , respectively. There'27s no NSCursor instance for the wait cursor. The wait cursor is displayed automatically by the system, without any required program intervention.
fs16 
fs28 pard s19 li100 fi0 ri1007 ql f0 b fs24 
fs28 Initializing a New NSCursor Object
fs14 
fs28 pard s9 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (id)b initWithImage:b0 (NSImage *)i newImagei0 tab Initializes a new NSCursor object with i newImagei0 .
pard s19 li100 fi0 ri1007 ql f0 b fs48 
fs28 Defining the Cursor
fs14 
fs28 pard s9 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (NSPoint)b hotSpotb0 tab Returns the point on the cursor that'27s aligned with the mouse.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSImage *)b imageb0 tab Returns the NSImage object that has the cursor image.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setHotSpot:b0 (NSPoint)i spoti0 tab Sets the point on the cursor that'27s aligned with the mouse.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setImage:b0 (NSImage *)i newImagei0 tab Makes i newImagei0  the NSImage object that supplies the cursor image.
pard s19 li100 fi0 ri1007 ql f0 b fs48 
fs28 Setting the Cursor
fs14 
fs28 pard s9 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 + (void)b hideb0 tab Hides the cursor. 
fi-6552 fs16 
fs28 fi-6552 + (void)b popb0 tab Restores the previous cursor.
fi-6552 fs16 
fs28 fi-6552 + (void)b setHiddenUntilMouseMovesb0 :(BOOL)i flagi0 ;tab Hides cursor when i flagi0  is YES; reveals it otherwise.
fi-6552 fs16 
fs28 fi-6552 + (void)b unhideb0 tab Shows the cursor.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b isSetOnMouseEnteredb0 tab Returns YES if b mouseEntered:b0  sets cursor.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b isSetOnMouseExitedb0 tab Returns YES if b mouseExited:b0  sets cursor.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b mouseEntered:b0 (NSEvent *)i theEventi0 tab Responds to a mouse-entered event by setting the cursor if b setOnMouseEnteredb0  was sent.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b mouseExited:b0 (NSEvent *)i theEventi0 tab Responds to a mouse-exited event by setting the cursor if b setOnMouseExitedb0  was sent.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b popb0 tab Removes the topmost NSCursor object from the cursor stack, and makes the next NSCursor down the current cursor.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b pushb0 tab Puts the receiving NSCursor on the cursor stack and sets it to be the current cursor. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setb0 tab Sets the NSCursor to be the current cursor.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setOnMouseEntered:b0 (BOOL)i flagi0 tab Determines whether b mouseEntered:b0  sets cursor.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setOnMouseExited:b0 (BOOL)i flagi0 tab Determines whether b mouseExited:b0  sets cursor.
pard s19 li100 fi0 ri1007 ql f0 b fs48 
fs28 Getting the Cursor
fs14 
fs28 pard s9 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 + (NSCursor *)b arrowCursorb0 tab Returns an arrow cursor. 
fi-6552 fs16 
fs28 fi-6552 + (NSCursor *)b currentCursorb0 tab Returns the current cursor.
fi-6552 fs16 
fs28 fi-6552 + (NSCursor *)b IBeamCursorb0 tab Returns an I-beam cursor. 
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.