Function Callback going to a different line

When a GUI is running and a callback (like a buttonpress) is initiated, it goes to the callback, does the thing the callback tells it to, then goes back to the line of code it was on before the callback was initiated. How do you get it to go to a different line of code after the callback? If clarification is needed I can provide it. It's an odd question.

4 件のコメント

Jan
Jan 2017 年 4 月 5 日
編集済み: Jan 2017 年 4 月 5 日
There is no way to manipulate the Matlab interpreter to change the currently processed code. Please explain what you need and there will be another way than magic.
Marcus Blackburn
Marcus Blackburn 2017 年 4 月 5 日
Right now I have a GUI, in which the user gets information using imrect from an image. Multiple images are loaded, and they can scroll through them using a pushbutton. Right now the program waits for the imrect box to be drawn before it proceeds. This is the only point that someone can hit a pushbutton. When the button is pressed, the next image is displayed after another imrect box is drawn. I would like it to just proceed to the next image, without having to draw another box.
Jan
Jan 2017 年 4 月 5 日
This is a limitation of imrect. You could use rbbox or dragrect instead. Or start imrect only by a callback of the WindowsButtonDownFcn, when the mouse is pressed. Then you can proceed with the code freely.
Marcus Blackburn
Marcus Blackburn 2017 年 4 月 5 日
Thank you

回答 (0 件)

この質問は閉じられています。

質問済み:

2017 年 4 月 5 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by