Re: Unable to re-add tracking area after it's been removed

2011-07-18 Thread Quincey Morris
On Jul 17, 2011, at 12:22, Gabriel Roth wrote: myTrackingArea = [[NSTrackingArea alloc] initWithRect:self.blueView.frame options:(NSTrackingMouseEnteredAndExited | NSTrackingActiveInActiveApp) owner:self userInfo:nil]; [self.blueView addTrackingArea:myTrackingArea]; Well, one

Re: Unable to re-add tracking area after it's been removed

2011-07-18 Thread Gabriel Roth
Well, one thing that's wrong is that the tracking area is supposed to be in the target view's coordinate system, that is, blueView's, but you specified it in blueView's parent view's coordinate system. IAC, if what you want is to track the mouse when it enter's blueView, then most likely

Re: Unable to re-add tracking area after it's been removed

2011-07-18 Thread Quincey Morris
On Jul 18, 2011, at 04:59, Gabriel Roth wrote: Thanks for the corrections. But changing the line in question to myTrackingArea = [[NSTrackingArea alloc] initWithRect:self.blueView.bounds options:(NSTrackingMouseEnteredAndExited | NSTrackingActiveInActiveApp | NSTrackingInVisibleRect )

Re: Unable to re-add tracking area after it's been removed

2011-07-18 Thread Gabriel Roth
Yes, that works—thanks very much. If anyone can explain why my original version didn't work, I'd appreciate it. My understanding was that the NSTrackingArea object would be allocate, initialized, and assigned to an ivar in the applicationDidFinishLaunching: method, and could then be added to and

Unable to re-add tracking area after it's been removed

2011-07-17 Thread Gabriel Roth
I'm attempting to add, remove, and re-add an instance of NSTrackingArea to a custom view. Adding works fine; removing works fine; but when I attempt to add it to the view again, the tracking area is not added. Here's the code: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification