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: Thu, 11 Dec 2003 08:08:04 -0500
You may be be to run your timer at a higher priority (NSModalRunLoop or
something), but the slider's modal loop may still prevent the timer
from being processed.
It is too NeXT implemented controls the way they did to steal events
directly instead of using Mouse Dragged through the normal responder
mechanism.
On Dec 9, 2003, at 5:04 PM, Louis Sinclair wrote:
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.
_______________________________________________
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.