Re: Capturing slider movement in NSSlider
Re: Capturing slider movement in NSSlider
- Subject: Re: Capturing slider movement in NSSlider
- From: Louis Sinclair <email@hidden>
- Date: Tue, 09 Dec 2003 16:04:31 -0600
- Organization: Minnetonka Software, Inc.
Hello,
Thanks for all the responses!
My situation was that I had a timer that I expected to work while the
slider was being dragged. I'm playing audio in one thread, and am
using the timer to update meters and monitor changes in a volume
slider. No timer events happen while the mouse is dragging the
control.
Using the -setContinuous method sort of works if I call my meter
code from the action method for the slider, but if the user stops
dragging while holding down the mouse, the meters stop. I'm
thinking I may have to start another thread instead of using a simple
timer if I want the display updates to continue regardless of what
the user is up to.
--
Louis Sinclair
Public Look wrote:
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.
_______________________________________________
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.