Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolling UIScrollView should update mouse entered/exited events for table view cells #81

Open
davisml opened this issue Mar 22, 2012 · 2 comments

Comments

@davisml
Copy link

davisml commented Mar 22, 2012

No description provided.

@johndpope
Copy link

so from what I can see -

UIKitView : NSView
NSTrackingArea *_trackingArea;

this has a tracking area for entire window block configured by ->
_trackingArea = [[NSTrackingArea alloc] initWithRect:self.bounds options:NSTrackingCursorUpdate | NSTrackingMouseMoved | NSTrackingInVisibleRect | NSTrackingActiveInKeyWindow | NSTrackingMouseEnteredAndExited owner:self userInfo:nil];
[self addTrackingArea:_trackingArea];

which gets a callback when mouse goes on and off the screen

  • (void)mouseEntered:(NSEvent *)theEvent {
    NSLog(@"mouseEntered");
    [self mouseMoved:theEvent];
    }
  • (void)mouseExited:(NSEvent *)theEvent {
    NSLog(@"mouseExited");
    }

UIView doesn't have a addTrackingArea:_trackingArea - method.....
so an attempt to port this - is probably futile as used need to replicate the nsviews and the uitableview has a queue of cells and the problem would grow trying to duplicate the uiview stack to nsviews....

however - we do have point inside method in uikit.
and if we can track the current mouse position - along with pointInside - we may be able fudge it.
I'm going to take a look.

  • (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
  • (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event;

@johndpope
Copy link

ok - I got it.

In your subclass of uitableviewcell - override these methods for correct callbacks.

  • (void)mouseEntered:(UIView *)view withEvent:(UIEvent *)event;
  • (void)mouseMoved:(UITouch *)touch withEvent:(UIEvent *)event;
  • (void)mouseExited:(UIView *)view withEvent:(UIEvent *)event;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants