Re: NSCell mouse tracking best practices.
Re: NSCell mouse tracking best practices.
- Subject: Re: NSCell mouse tracking best practices.
- From: mmalc crawford <email@hidden>
- Date: Wed, 5 Jul 2006 13:40:16 -0700
On Jul 5, 2006, at 1:17 PM, Óscar Morales Vivó wrote:
- Keep around an instance variable for the tracking rectangle. Fill
it up in trackMouse:inRect:ofView:untilMouseUp: right before calling
super, and then override startTrackingAt:inView:,
continueTracking:at:inView and stopTracking:at:inView:mouseIsUp:
(NSSliderCell seems to do this).
- Just override the whole trackMouse:inRect:ofView:untilMouseUp:
taking care of the event loop there and ignoring the other three
mouse tracking methods (That's what the clock control sample code
does).
Personally I would avoid the latter since it makes it more difficult
to alter behaviour in a subclass -- depending on what you do, it may
also interfere with support for bindings.
I've put an updated, bindings-enabled, version of ClockControl at:
<http://homepage.mac.com/mmalc/CocoaExamples/ClockControl2a.zip>
Note that it (still) represents a work in progress. Bug reports are
welcome.
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden