Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSCursorMBS class.

NSCursorMBS.Constructor(image as NSImageMBS, foregroundColorHint as NSColorMBS, backgroundColorHint as NSColorMBS, HotSpotX as Double, HotSpotY as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Initializes the cursor with the specified image and hot spot.

See also:

NSCursorMBS.Constructor(image as NSImageMBS, HotSpotX as Double, HotSpotY as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Initializes the cursor with the specified image and hot spot.

See also:

NSCursorMBS.hotSpotX as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the position of the cursor's hot spot.
Example
// shows cursor in window
dim c as NSCursorMBS = NSCursorMBS.arrowCursor

MsgBox str(c.hotSpotX)+"/"+str(c.hotSpotY)

The point describing the position of the hot spot, specified according to the cursor's flipped coordinate system.

For a more complete explanation, see the class description.

Note that an NSCursor object is immutable: you cannot change its hot spot after it's created. Instead, use the Constructor to create a new cursor with the new settings.

Some examples using this method:

NSCursorMBS.hotSpotY as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the position of the cursor's hot spot.
Example
// shows cursor in window
dim c as NSCursorMBS = NSCursorMBS.arrowCursor

MsgBox str(c.hotSpotX)+"/"+str(c.hotSpotY)

The point describing the position of the hot spot, specified according to the cursor's flipped coordinate system.

For a more complete explanation, see the class description.

Note that an NSCursor object is immutable: you cannot change its hot spot after it's created. Instead, use the Constructor to create a new cursor with the new settings.

Some examples using this method:

NSCursorMBS.image as NSImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the receiver's image.
Example
// shows cursor in window
dim c as NSCursorMBS = NSCursorMBS.arrowCursor
dim i as NSImageMBS = c.image
window1.Backdrop=i.CopyPictureWithMask

The cursor image or nil if none exists

Note that an NSCursor object is immutable: you cannot change its image after it's created. Instead, use the constructor to create a new cursor with the new settings.

NSCursorMBS.isSetOnMouseEntered as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value indicating whether the receiver becomes current on receiving a mouseEntered message.

True if the receiver will become current when it receives a mouseEntered message; otherwise, false.

To receive such a message, the receiver must first be assigned a cursor rectangle. This assignment can be made using the NSView method addCursorRect. For a more complete explanation, see the class description.

NSCursorMBS.isSetOnMouseExited as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value indicating whether the receiver becomes current when it receives a mouseExited: message.

True if the receiver becomes current when it receives a mouseExited: message; otherwise, false.

To receive such a message, the receiver must first be assigned a cursor rectangle. This assignment can be made using the NSView method addCursorRect. For a more complete explanation, see the class description.

NSCursorMBS.mouseEntered(e as NSEventMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Automatically sent to the receiver when the cursor enters a cursor rectangle owned by the receiver.

If used after setOnMouseEntered has been called with an argument of true, mouseEntered can make the receiver the current cursor.

In your programs, you won't invoke mouseEntered explicitly. It's only included in the class interface so you can override it.

For a more complete explanation, see "Handling Tracking-Rectangle and Cursor-Update Events in Views" and the NSView method addTrackingRect

NSCursorMBS.mouseExited(e as NSEventMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Automatically sent to the receiver when the cursor exits a cursor rectangle owned by the receiver.

Like mouseEntered, this message is part of the class interface only so you can override it.

For a more complete explanation, see "Handling Tracking-Rectangle and Cursor-Update Events in Views" and the NSView method addTrackingRect.

NSCursorMBS.pop

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sends a pop message to the receiver's class.

See also:

NSCursorMBS.push

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Puts the receiver on top of the cursor stack and makes it the current cursor.

NSCursorMBS.set

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Makes the receiver the current cursor.

If your application is not the front application, the system will ignore this set message!

NSCursorMBS.setOnMouseEntered(flag as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
pecifies whether the receiver accepts mouseEntered: events.

True if the receiver accepts future mouseEntered event messages; otherwise it ignores them.

Accepting mouseEntered event messages allows the cursor to be made the current cursor when the cursor enters a view's cursor rectangle.

NSCursorMBS.setOnMouseExited(flag as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets whether the receiver accepts mouseExited events.

flag: True if the receiver accepts future mouseExited: event messages; otherwise it ignores them.

Accepting mouseExited event messages allows the cursor to be made the current cursor when the cursor exits a view's cursor rectangle.

The items on this page are in the following plugins: MBS MacBase Plugin.


The biggest plugin in space...