How to pause a listener(use in a scroll bar)

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

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?
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)

Sign in to comment.

Answers (0)

Asked:

on 5 Oct 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!