• 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
NSTextFieldCell and trackMouse
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSTextFieldCell and trackMouse
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: dealloc for cleanup versus freeing memory
  • Next by Date: Re: Control doesn't stay centered?
  • Previous by thread: [MODERATOR] - Please do not post "offtopic" threads
  • Next by thread: Re: NSTextFieldCell and trackMouse
  • Index(es):
    • Date
    • Thread