• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
addTrackingRect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

addTrackingRect


  • Subject: addTrackingRect
  • From: Gerard Iglesias <email@hidden>
  • Date: Tue, 1 May 2001 00:34:45 +0200

Well a second question than :-)

When I add a tracking rect I make it in my override of resetCursorRect,
but id doesn't seems to be the best place.
For example if the mouse is in the rect when the window appear, then I
receive nothing, I have to go out of the view before receiving anything?

This is the classicla way I use to do that:

- (void)resetCursorRects
{
if (trackTag_ != -1)
[self removeTrackingRect:trackTag_];

trackTag_ = [self addTrackingRect:[self visibleRect]
owner:self
userData:nil
assumeInside:NO];
}


or an other way with a more smart assumeInside parameter :

- (void)resetCursorRects
{
NSRect rect = [self visibleRect];
BOOL mouseInRect;
NSPoint mloc = [[self window] mouseLocationOutsideOfEventStream];

mloc = [self convertPoint:mloc fromView:nil];
mouseInRect = [self mouse:mloc inRect:rect];

if (trackTag != -1)
[self removeTrackingRect:trackTag];

trackTag = [self addTrackingRect:rect
owner:self
userData:nil
assumeInside:mouseInRect];
}


Thank you in adavance.

--
email@hidden
Ph.D. in Computer Graphics MacOS X-Cocoa to have fun
Project manager at www.visiotics.com Win32/MFC to eat


  • Next by Date: Re: loading executable code, NSBundle
  • Next by thread: Re: loading executable code, NSBundle
  • Index(es):
    • Date
    • Thread