gui slider disappears from figure

12 ビュー (過去 30 日間)
Mads
Mads 2017 年 6 月 14 日
コメント済み: Adam 2017 年 6 月 14 日
I have a script that when runs opens a gui. It has several sliders.
When I run the script with one particular input everything works fine.
When I run the script with another input one particular slider disappears once I start to assign entries to its handle, fx.:
set(slider,'Min',1)
I have followed this in debug mode, and I see that it is still supposed to be Visible (this entry is stil 'on')! It could be another entry that I change, and then it disappears. Also the position remains correct.
But as I said, if the input to the script is another, the troubled slider remains and works as it should.
According to another thread: I do set the units before the position...

採用された回答

Adam
Adam 2017 年 6 月 14 日
Problems with sliders disappearing usually come with a warning on the command line and are often associated with setting an illegal state where the min > max or the value does not fit within the specified range.
The fact you say this happens after
set(slider,'Min',1)
indicates this is the problem if e.g. max is 0.
When you are editing the min, max and value properties of a slider it is best to edit these all in one statement as e.g.
set( slider, 'Min', 1, 'Max', 2, 'Value', 1.5 )
and ensure that the min, max and value are valid with respect to each other.
  2 件のコメント
Mads
Mads 2017 年 6 月 14 日
Adam, you were right about the max value being wrong. To compact three set()'s into one didn't help though. So it works again now. Thanks!
Adam
Adam 2017 年 6 月 14 日
No, setting all 3 at once will not help if they are not valid with respect to each other, but it does eliminate warnings being spewed to command line if you do them in succession and the slider is temporarily in an invalid state mid-way through.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by