NSTextFieldCell and trackMouse
NSTextFieldCell and trackMouse
- Subject: NSTextFieldCell and trackMouse
- From: Seth Pellegrino <email@hidden>
- Date: Mon, 6 Aug 2007 00:00:18 -0400
Hello list,
I have a custom NSTextFieldCell subclass, and in that subclass I
override -trackMouse:inRect:ofView:untilMouseUp because I want to
capture mouse events (specifically mouse down events). However, -
trackMouse never gets called. I've built a test case (code follows),
and it seems that -trackMouse doesn't function properly for even
normal, completely untouched NSTextFieldCells. What am I missing?
Test case is:
@implementation MyTextFieldCell
- (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame
ofView:(NSView *)controlView untilMouseUp:(BOOL)flag
{
NSLog(@"Ta-da!");
return [super trackMouse:theEvent inRect:cellFrame
ofView:controlView untilMouseUp:flag];
}
@end
The above in an NSMatrix (with mode set to 'Track') never produces
"Ta-Da!" in the output. Am I setting up my NSMatrix incorrectly?
Google searches tell me that trackMouse in an NSTextFieldCell works
fine for others, but I can't see what I'm doing that would prevent my
case from working.
Any help understanding what's going on would be greatly appreciated.
Thank you all,
Seth
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden