loop while in a GUI stopped by callback
古いコメントを表示
hello everybody, I'm french so excuse me for my english. I'm doing a GUI and I want to do a loop while which has to stop when a checkbox called TR is checked :
while (get(handles.TR,'Value'))
.
.
.
end
But in the loop, matlab don't receive the callback and the value of the checkbox is not changed I don't know how I have to do....
thank you for your help
回答 (4 件)
Fangjun Jiang
2011 年 8 月 17 日
0 投票
The computer will be running the while loop and be too busy to process your click on the checkbox. Add a pause(1) line in the while loop might help.
trajik
2011 年 8 月 17 日
trajik
2011 年 8 月 17 日
0 投票
1 件のコメント
Fangjun Jiang
2011 年 8 月 17 日
I made a quick test. Both pause() and drawnow() works. drawnow() is a better choice. Hope you understand the underline cause now.
カテゴリ
ヘルプ センター および File Exchange で Graphics Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!