Can't deactivate slider
12 ビュー (過去 30 日間)
Andrew Diamond 2018 年 8 月 19 日
コメント済み: Image Analyst 2018 年 8 月 21 日
I have a callback (not the slider) in which until it's complete I don't want the user using the slider. So, in that callback I disabled the slider (i.e.'enable', 'off'). The property editor shows that to be the case. However, if I click on the slider the enable property turns back on. I can bypass the logic in the slider callback (that's a different callback) but even so the slider indicator (the thing that moves on the slider to show you where you are) still moves.
So, is there anyway to stop/disable user input from triggering the slider to begin with?
回答 (2 件)
Well you can hide it. Try setting the visible property to off
handles.slider1.Visible = 'off';
Andrew, you're using the old fashioned way. I'm using the modern OOP way. They're equivalent.
See my other answer for a fully functioning demo.
Image Analyst 2018 年 8 月 21 日
I do not change the slider value by programmatic control (code). I do let you change it by clicking on it with the mouse (mouse control). Then the push buttons enable or disable the slider plus the text above the slider.
I'm glad it helped you figure out that the problem lied with some other function. You could at least vote for the solution if you don't consider that it helped enough to be an answer.
Find more on Interactive Control and Callbacks 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!