stopTracking(last:current:in:mouseIsUp:)
Stops tracking mouse events within the receiver.
Declaration
func stopTracking(last lastPoint: NSPoint, current stopPoint: NSPoint, in controlView: NSView, mouseIsUp flag: Bool)Parameters
- lastPoint:
Contains the previous position of the cursor.
- stopPoint:
The current location of the cursor.
- controlView:
The
NSControlobject managing the receiver. - flag:
If True, this method was invoked because the user released the mouse button; otherwise, if False, the cursor left the designated tracking rectangle.
Discussion
The default NSCell implementation of trackMouse(with:in:of:untilMouseUp:) invokes this method when the cursor has left the bounds of the receiver or the mouse button goes up. The default NSCell implementation of this method does nothing. Subclasses often override this method to provide customized tracking behavior. The following example increments the state of a tristate cell when the mouse button is clicked:
- (void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint
inView:(NSView *)controlView mouseIsUp:(BOOL)flag
{
if (flag == YES) {
[self setTriState:([self triState]+1)];
}
}