Could anyone help understanding this issue.
Problem: Set up a tracking area in an existing view.
Hillegass Solution. In the -(void)viewDidMoveToWindow, the following code.
Running this code using NSLog statements in -mouseEntered and -mouseExited methods, as soon as the mouse enters the view, and on leaving the view, I get the appropriate console messages. **Even** when changing the init to, for example, "initWithRect: NSMakeRect(0,0,10,10), I get the same response from the view ie the **entire** view is tracked.
So, my question is what is the purpose of the Rect in the init, OR why does NSZeroRect work at all?
Thanks, in advance, for any help.
Problem: Set up a tracking area in an existing view.
Hillegass Solution. In the -(void)viewDidMoveToWindow, the following code.
Code:
-(void) viewDidMoveToWindow
{
int options = NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways | NSTrackingInVisibleRect ;
NSTrackingArea *ta;
ta = [[NSTrackingArea alloc] initWithRect:NSZeroRect
options:options
owner:self
userInfo:nil];
[self addTrackingArea:ta];
[ta release];
}
Running this code using NSLog statements in -mouseEntered and -mouseExited methods, as soon as the mouse enters the view, and on leaving the view, I get the appropriate console messages. **Even** when changing the init to, for example, "initWithRect: NSMakeRect(0,0,10,10), I get the same response from the view ie the **entire** view is tracked.
So, my question is what is the purpose of the Rect in the init, OR why does NSZeroRect work at all?
Thanks, in advance, for any help.