Re: Notification for mouse-up on NSStepper
Re: Notification for mouse-up on NSStepper
- Subject: Re: Notification for mouse-up on NSStepper
- From: Alastair Houghton <email@hidden>
- Date: Fri, 7 Dec 2007 10:41:32 +0000
On 6 Dec 2007, at 22:41, John Stiles wrote:
I suspect (but haven't yet tested) that NSStepper overrides -
mouseDown: and runs its own event loop while the mouse button is
down, and consumes the mouse-up event. If that's the case, then I
could override -mouseDown:, call [super mouseDown:event] and then
once it returns, I know the mouse has been released and the stepper
has already gone through all of its motions. However, I am not sure
that this is a safe thing to rely on; I hate to rely on
implementation details that could be subject to change.
Is there a good way to do this that I haven't thought of?
FWIW, I can't think of one, and I've also had to write code previously
that relies on the system-provided classes using the tracking-loop
approach to mouse tracking.
I doubt Apple will change any class currently using a tracking-loop to
use three-method tracking, but it would be nice to have some guarantee
that any system-defined NSResponder subclass that currently tracks the
mouse this way will *always* track the mouse this way, at least for
applications built on currently shipping systems.
It's a shame that there's no obvious way from code to distinguish
between the two cases (i.e. tracking loop versus three-method approach).
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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