62 questions
0 votes
1 answer
78 views
How can I make NSCursor hide in full screen macOS window?
import SwiftUI import Combine struct ContentView: View { @State private var activityTimer: Cancellable? @State private var activityCountDownInterval: TimeInterval = 3 @State private var ...
5 votes
2 answers
535 views
Resize cursors are missing in `NSCursor`
I'm writing a resizable view in SwiftUI on macOS. Drag its edge can change its size. I'd like to show according cursor when dragging different edges. So I looked up Apple NSCursor documentation, ...
0 votes
0 answers
371 views
Disable cursor change while inside tracking area in swift
I'm trying to change cursor while the cursor is inside a view. The problem is that the cursor resets to its default automatically sometimes(for example when a notification popup shows up.) class ...
-1 votes
1 answer
448 views
On mouse hover on NSButton Change Cursor (for OSX)
I made a subclass of NSButton class Button: NSButton { var cursor = NSCursor() override func resetCursorRects() { super.resetCursorRects() ...
2 votes
0 answers
501 views
Swift:Change System Cursor
I created a simple macos app project in Swift. The app changes the NSCursor image with a custom image. This works fine but as soon as I click on a different app, e.g. Safari, macos restores the ...
0 votes
1 answer
260 views
How do I create a custom NSCursor with alpha mask?
When I create a custom NSCursor in Objective-C the alpha channel mask appears to XOR the screen below. I am expecting an alpha channel value of zero to be transparent, not XOR the graphics below. I am ...
4 votes
0 answers
254 views
Replicate cursor behaviour from the macOS screenshot tool
Disclaimer; barely a novice when it comes to Swift/macOS development. The Ctrl+Shift+4 screenshot tool on macOS, has an accompanying cursor change that I've been looking for a way to replicate. In ...
4 votes
0 answers
250 views
Cocoa API keeps resetting our NSCursor
We have an application that has a full screen video player and a floating window (pallet) can be brought up to give users tools to modify the video, there is only one view for video playback and all ...
1 vote
2 answers
3k views
How to change cursor on hover NSTextView? Swift 4, Xcode 9.4
I have a simple NSTextView, which looks like a hyperlink and I want to change the cursor on the pointer when the user hovers this NSTextView. How can I do it? I know about NSCursor, but apple docs ...
2 votes
0 answers
449 views
NSCursor get the 'move' (4 arrows / arrow cross) cursor
I want to get the NSCursor for the move cursor (Figure 1). I was looking for cursors that weren't publicly exposed in NSCursor and came across this question. Especially pertinent is the last answer, ...
1 vote
1 answer
1k views
How to set a custom cursor in an SKScene? (XCode, Swift4, Spritekit)
I want to use a custom cursor for my project. Now, using one of the system cursors in XCode is no biggie, i simply call: NSCursor.crosshair() .set() (just an example) This works fine but then I try ...
5 votes
1 answer
819 views
How to prevent a NSCursor from change?
I have a problem while I try to prevent a cursor from changing. I try to put an overlay view over entire window, but, if under that overlay exist an NSTextView, this will force cursor to change. I ...
1 vote
1 answer
293 views
Hotspot in Windows cursor .cur loaded by NSImage?
According to the Cocoa Drawing Guide documentation for Images, NSImage can load a Windows cursor .cur file. But how do I obtain the hotspot needed for NSCursor - initWithImage:(NSImage *)newImage ...
3 votes
2 answers
859 views
How to disable all NSCursor updates in my application?
In my macOS application, I have a custom WebView. When the user moves the mouse cursor over different elements in the WebView's webpage like text, links, etc. (which are implemented as subviews, I ...
0 votes
0 answers
117 views
OSX: Control where the red item count badge on NSCursor appears during drag
My app, which accepts drags from other apps, has to choose its own cursors during a drag over its window. For example, it has to be able to show the dragLinkCursor even if the user doesn't hold the ...