フィルターのクリア

About callback function in GUI

1 回表示 (過去 30 日間)
Yang
Yang 2012 年 3 月 15 日
I have a GUI program. One button is to call a for loop which shows lots of image on the UI. And I want to have another button which can stop this loop. But I find that the callback function are separately. How can I write codes in the callback function of "stop" button to control the loop in another callback function?

回答 (1 件)

Jan
Jan 2012 年 3 月 15 日
The "stop" button can set a value store in the figure, e.g. UserData or ApplicationData, see doc guidata.
Then the running callback can read this variable and stop on demand. Do not forget to insert a drawnow to allow the execution of the "stop"-buttons callback.

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by