Questions tagged [nscursor]

In OS X, instances of the NSCursor class manage the appearance of the cursor

61 questions
19
votes
1 answer

NSCursor: Using high-resolution cursors with cursor zoom (or retina)

In OSX the user can zoom the mouse cursor using the accessibility system preferences. Since Lion (I think) OSX stores the cursors as PDFs and is able to resize them smoothly. I want the same functionality for my app but using PDFs as the NSImage…
Raphael Schweikert
  • 18,244
  • 6
  • 55
  • 75
15
votes
3 answers

NSCursor always resets to Arrow

Why can't I get the cursor to stay put for the duration of my mouse drag? As soon as I start dragging, it reverts to "Arrow" (even though I set it as open hand in the app delegate after launch). - (void)mouseDown:(NSEvent *)event { [[NSCursor…
borrrden
  • 33,256
  • 8
  • 74
  • 109
10
votes
1 answer

Can I change the current cursor from an inactive application?

I’ve got a utility Mac application that runs in the background (LSUIElement enabled). Under some condition this application displays a menu window with several buttons. The problem is that when I hover over this window the mouse cursor still behaves…
zoul
  • 102,279
  • 44
  • 260
  • 354
8
votes
2 answers

Cocoa nsview change cursor

I tried to change the default cursor in my cocoa application. I read about this but the standard approach isn't working for me. I try to add to my OpenGLView subclass this method: - (void) resetCursorRects { [super resetCursorRects]; …
sch_vitaliy
  • 91
  • 1
  • 2
8
votes
1 answer

Cocoa predefined resize mouse cursor?

Is the resize mouse cursor used by Preview (e.g. when resizing shapes) a system cursor? It's not available directly as a method in NSCursor but then it doesn't look like there's a private resource for the cursor in the Preview app's bundle…
ATV
  • 4,116
  • 3
  • 23
  • 42
8
votes
4 answers

Native OSX Lion resize cursor for custom NSWindow or NSView

If we use NSTrackingArea for some specified region then we can implement such method to change the default cursor: -(void)cursorUpdate:(NSEvent *)theEvent { [[NSCursor resizeLeftCursor] set]; } I implementing custom resize for NSWindow, which…
Vadim
  • 167
  • 1
  • 12
6
votes
0 answers

NSCursor's disappearingItemCursor not staying set outside of window

I have a pop-down status bar application that contains an NSTableView. When a row is dragged outside the table (drag-drop works here completely, this is not the focus of the question) I change the cursor to be the poofy-pointer, otherwise known as…
coneybeare
  • 33,113
  • 21
  • 131
  • 183
6
votes
2 answers

How to force the cursor to be an "arrowCursor" when it hovers a NSButton that is inside a NSTextView?

Okay, here is the problem: I have a NSTextView and I add my custom NSButton using: [_textView addSubview:button]; Then, inside my NSButton subclass, I have (along with the NSTrackingArea stuff): - (void)mouseEntered:(NSEvent *)event{ …
Pedro Vieira
  • 3,330
  • 3
  • 41
  • 76
6
votes
5 answers

Can't change the mouse cursor of a NSTextField

I'm trying to change the mouse cursor of a NSTextField in a window sheet, loaded from a NIB. Following the documentation, I have subclassed NSTextField and implemented resetCursorRects. - (void) resetCursorRects { [self addCursorRect:[self…
hpique
  • 119,096
  • 131
  • 338
  • 476
5
votes
1 answer

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 want to prevent that, and keep the arrow cursor…
C-Viorel
  • 1,801
  • 3
  • 22
  • 41
5
votes
1 answer

How to change NSCursor globally?

I am developing an application with several windows and views (NSTextView, etc.). I would like to change the cursor globally in my application, so that even if the cursor enters the trackingRect of (for instance) an NSTextView it does not change. Is…
Colas
  • 3,473
  • 4
  • 29
  • 68
5
votes
1 answer

What can cause CGDisplayCreateImageForRect to capture or ignore the cursor?

I'm capturing the screen on osx with capturedImage = CGDisplayCreateImageForRect(displayID, CGRectMake(point.x - 4, point.y - 4, 8, 8)); This returns the portion of the screen under the cursor. Later on I'm setting a custom image cursor…
Juank
  • 6,096
  • 1
  • 28
  • 28
5
votes
1 answer

How to watch for changes in [NSCursor currentCursor]?

I've got an app with a custom cursor which I achieved using a custom wrapper for NSCursor (most of the main code is designed to be OS portable, so above that I pretend the NSCursor is a Windows-style cursor). I'm having a few issues with the cursor…
benwad
  • 6,414
  • 10
  • 59
  • 93
4
votes
1 answer

Custom NSCursor does not hold for all applications

I have written a Cocoa program to change the cursor after a button press. Specifically, the cursor includes an image instead of a pointer. I set it using the following commands: NSImage *tmpImage = [NSImage imageNamed:@"pointer"]; NSCursor *pointer…
AJJ
  • 105
  • 1
  • 2
  • 5
4
votes
0 answers

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 its initial launch state, it's a crosshair with…
rhardih
  • 863
  • 1
  • 10
  • 18
1
2 3 4 5