Questions tagged [nstrackingarea]

Cocoa's class for tracking mouse movement within a view.

37 questions
38
votes
2 answers

mouseExited isn't called when mouse leaves trackingArea while scrolling

Why mouseExited/mouseEntered isn't called when mouse exits from NStrackingArea by scrolling or doing animation? I create code like this: Mouse entered and exited: -(void)mouseEntered:(NSEvent *)theEvent { NSLog(@"Mouse…
Justin Boo
  • 10,132
  • 8
  • 50
  • 71
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
10
votes
2 answers

How to implement NSTrackingArea's mouseEntered/Exited with animation?

I want to implement a feature that when an user hovers over the specific area, the new view appears with drawer-like animation. And also, when the user leaves the specific area, the drawer should go away with animation. This is exactly what you see…
Blaszard
  • 30,954
  • 51
  • 153
  • 233
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

Unable to start an NSTrackingArea

I have an NSOutlineView that I'd ike to have mouseEntered: and mouseExited: updates during drag and drop. So I've tried to add an NSTrackingArea to it. Within my outline view sub-class I have: let target = self.frame let options =…
Todd
  • 1,770
  • 1
  • 17
  • 42
5
votes
2 answers

Set the cursor to a pointing hand over a text view

Is there a way to set the cursor to a pointing hand over a text view without subclassing NSTextView? I read a lot about NSTrackingAreas, tested a lot of examples, set different tracking options and implemented different methods, but the cursor still…
berfis
  • 417
  • 4
  • 17
3
votes
1 answer

Disable NSView mousedown

i have an NSScrollView with an NSView set as its document view. I am trying to get the mousedown event in the NSScrollView but the NSView keeps intercepting it. Is there a way of stopping this from happening? Also is there a way of stopping it in…
BenJacob
  • 957
  • 10
  • 31
3
votes
1 answer

Swift NSTextField text disappears

This questions MIGHT exist on a 6 year old post in objective-c. I haven't found a recent answer or question that works, or one that is written in Swift. I'm using storyboards and I have subclassed NSTextField. For some reason when I click into the…
Steven Schafer
  • 834
  • 3
  • 10
  • 24
3
votes
2 answers

Mouseovers in NSCollectionView+NSScrollView

In a 10.7+ project, I am trying to enable UI elements in an NSCollectionViewItem when the mouse is within the bounds of the collection view item's view. For each collection view item which populates the NSCollectionView, I have a custom view which…
ctpenrose
  • 1,467
  • 2
  • 18
  • 28
2
votes
1 answer

NSImage mouse events

I have a number of NSImages that I'm rendering in a custom NSView subclass. I'm looking to enlarge theses images as and when the user places their mouse over them and am wondering about the best way to go about doing this. Currently I'm using the…
ndg
  • 2,585
  • 2
  • 33
  • 58
2
votes
0 answers

How to display button on mouse hover in OutlineView cells

I have an outlineview and I'm able to implement mouse hover feature and select row on hover of mouse using NSTrackingArea. I have buttons at the end of each cell. I want to hide all buttons in the beginning. On mouse hover, button should get enable…
Lakshmi Yadav
  • 156
  • 1
  • 10
2
votes
1 answer

Read dictionary from NSEvent userData

I have created an NSTrackingArea and I am passing a Dictionary in the userInfo argument. let trackingData = ["section": 1, "sectionRow": 12, "done": false] let trackingArea = NSTrackingArea( rect: cellView.bounds, …
Shakeeb Ahmad
  • 2,010
  • 1
  • 25
  • 30
2
votes
1 answer

Objective-C | NSBezierPath draw and color on action

I have a custom view class with a tracking area. I want that, when the mouse enters the tracking area, a bezier is drawn with a color, and when the mouse exits the area the bezier disappear. In order to make it disappear I read that the only way is…
2
votes
1 answer

NSTrackingArea not fully working when not key window

A bit of context first. Essentially I have a window that is covering the desktop. On it I have a few WebKit WebView views which allow user interaction. By deafult, as one would expect, when another application is active it does not receive these…
Oliver Cooper
  • 849
  • 7
  • 20
1
2 3