How to pause a listener(use in a scroll bar)
Show older comments
Hey,
I use the below code to move an annotation line across a plot depending on the position of the slider.
mainbox.hhSlider = handle(mainbox.slider_handle);
mainbox.hProp = findprop(mainbox.hhSlider,'Value');
mainbox.hListener = handle.listener(mainbox.hhSlider,mainbox.hProp,'PropertyPostSet',@slider_seek);
I would like to cause the listener to not operate unless a mousedown event occurs. Any ideas?
2 Comments
Jan
on 5 Oct 2011
You want to move the slider and delay the update of the display until the next mouse-down event? This sound not intuitive. And to which obejct should this mouse-down event belong to?
Jonas Reber
on 7 Oct 2011
why don't you use:
lh = addlistener(sliderhandle, 'ActionEvent',@updateline); ?
this gives you a continuous feedback of the moved slider if the mouse is down (in R2011+ use ContinuousValueChange instead of ActionEvent)
Answers (0)
Categories
Find more on Clocks and Timers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!