Re: NSTextFieldCell and trackMouse
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