Note that there are some explanatory texts on larger screens.

plurals
  1. POmouseDown event on NSSlider
    primarykey
    data
    text
    <p>I have hit a bit of a wall and would really appreciate some help.</p> <p>I have an NSSlider that I am using to control the jog speed of a QTMovie.</p> <p>I want the rate of the video to playback according to the slider value. This is easy to do.</p> <p>The problem is that I want the NSSlider to reset to '0' when the user's event "mouseUp" is completed. I can't seem to get this event to work, so I have subclassed NSSlider and implemented mousedown &amp; mouseup methods, and added a delegate to the NSSlider subclass and connected that to my app's controller.</p> <p>It sort of works, but there is a massive delay on the slider - it slides fine, but the video rate doesn't change, and only does when I 'mouseUp' - basically it seems the mouseDown is called on the MouseUp.</p> <p>I hope some of that makes sense.</p> <p>Hopefully someone out there can help me out,</p> <p>Cheers,</p> <p>Adam</p> <pre><code>enter code here </code></pre> <p>my NSSlider subclass .m file:</p> <pre><code>@implementation TimeScrubberSlider   @synthesize delegate;     - (void)mouseDown:(NSEvent *)theEvent  {   // dispatch_queue_t myQueue = dispatch_queue_create("com.mycompany.myqueue", 0); // dispatch_async(myQueue, ^{     NSLog(@"mouseDown");   [super mouseDown:theEvent];   if ([delegate respondsToSelector: @selector(doScrubTime:)])   {   [delegate doScrubTime:nil];   }   [super mouseDown:theEvent];   // ); // dispatch_release(myQueue);   }     - (void) mouseUp: (NSEvent*) theEvent {   NSLog(@"mouseUp TimeScrubber");   [super mouseUp:theEvent];   [self setDoubleValue:0];   if ([delegate respondsToSelector: @selector(doScrubTime:)])   {   [delegate doScrubTime:nil];   }   [super mouseUp:theEvent];   }   </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload