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

Re: NSTextFieldCell and trackMouse


  • Subject: Re: NSTextFieldCell and trackMouse
  • From: Seth Pellegrino <email@hidden>
  • Date: Mon, 6 Aug 2007 08:29:30 -0400


On Aug 6, 2007, at 6:42 AM, I. Savant wrote:

On Aug 6, 2007, at 12:00 AM, Seth Pellegrino wrote:
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.

So ... why not override -mouseDown: instead of -trackMouse...?

Unfortunately, NSCell is not a descendant of NSResponder, so it has no -mouseDown: to override. According to stated in this thread: < http://lists.apple.com/archives/cocoa-dev/2006/Jul/msg00198.html > and CocoaDev < http://www.cocoadev.com/index.pl? WrappingTwoNSCellsIntoOne > the 'proper' way to track mouse events from within an NSCell is to use -trackMouse. The code included in my original email works perfectly if it is part of an NSButtonCell or NSSliderCell, but I can't get it to respond properly when part of an NSTextFieldCell. I'm especially confused because, according to the two sourced I quoted above, others have overriden -trackMouse and had it just work.


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>
    • Re: NSTextFieldCell and trackMouse
      • From: Alastair Houghton <email@hidden>
References: 
 >NSTextFieldCell and trackMouse (From: Seth Pellegrino <email@hidden>)
 >Re: NSTextFieldCell and trackMouse (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: GUI not responding possibly because of NSRunLoop, what can I do?
  • Next by Date: Re: dealloc for cleanup versus freeing memory
  • Previous by thread: Re: NSTextFieldCell and trackMouse
  • Next by thread: Re: NSTextFieldCell and trackMouse
  • Index(es):
    • Date
    • Thread