• 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
trouble getting mouseEntered/mouseExited to fire
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trouble getting mouseEntered/mouseExited to fire


  • Subject: trouble getting mouseEntered/mouseExited to fire
  • From: Chase <email@hidden>
  • Date: Sat, 23 Jul 2005 21:43:46 -0500

I can't get mouseEntered and mouseExited events to fire. I've done this before in previous apps. Not sure why all of a sudden I can't get it working. I'm sure I'm forgetting something simple. Please look at what I've got and tell me what I'm missing. Thanks.

I've got a subclass of NSView with the following methods:

- (BOOL)acceptsFirstResponder {
    return YES;
}

- (void)mouseEntered:(NSEvent *)theEvent {
    NSLog(@"mouseEntered");
}

- (void)mouseExited:(NSEvent *)theEvent {
    NSLog(@"mouseExited");
}

- (id)initWithFrame:(NSRect)frameRect {
self = [super initWithFrame:frameRect];
if (self) {
[self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO];
}
return self;
}





in my NSWindow subclass, I've got:


- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int) styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag {
self = [super initWithContentRect:contentRect styleMask:styleMask backing:backingType defer:flag];
if (self) {
NSRect rect = contentRect;
contentRect.origin.x = 0;
contentRect.origin.y = 0;
_content_view = [[ContentViewClass alloc] initWithFrame:contentRect];
[self setContentView:_content_view];
[self makeFirstResponder:_content_view];
}
return self;
}




Thanks.

- Chase





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Simple noob question
  • Next by Date: Re: [RESOLVED] trouble getting mouseEntered/mouseExited to fire
  • Previous by thread: Re: Drag and drop text clipping on to the dock's application icon
  • Next by thread: Re: [RESOLVED] trouble getting mouseEntered/mouseExited to fire
  • Index(es):
    • Date
    • Thread