Re: Capturing slider movement in NSSlider
Re: Capturing slider movement in NSSlider
- Subject: Re: Capturing slider movement in NSSlider
- From: Public Look <email@hidden>
- Date: Tue, 9 Dec 2003 12:42:12 -0500
Many Cocoa controls including NSSlider implement their own event
tracking loop. They start a modal loop stealing events in mouseDown:
and don't stop stealing events until mouseUp:. Apple's documentation
has/had sampel code showing exactly how that is done (regardless of
whether it was/is a good idea).
Fortunately for you, you don't need to subclass NSSlider to do what you
want. It already has a method, -setContinuous: inherited from
NSControl that does exactly what you want. You can also make a slider
continuous in IB.
On Dec 9, 2003, at 11:46 AM, Louis Sinclair wrote:
Hello,
I have a need to send changing NSSlider values as it is being dragged.
I've subclassed NSSlider and implemented mouseDown, mouseUp,
mouseDragged, and mouseMoved.
I'm getting the mouseDown and mouseUp events, but not the mouseDragged
or mouseMoved methods. I'm calling the setAcceptsMouseEvents method to
activate mouse moved events in the mouseDown method, and calling it
again to turn it off in the mouseDown method.
I've used the identical approach with a subclassed version of NSButton,
so it appears that NSSlider handles those events differently.
Can anyone shed any light on the proper way to do this?
Thanks in advance for any suggestions!
--
Louis Sinclair
mailto:email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.