How do I terminate "wait" function?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
I want to terminate or interrupt "wait" function if user presses a cancel button in a gui fig.
Here's a part of my code.
% create a dragable box
rect_h=imrect(gca, position);
while (flag)
% wait until user decides and confirms the box
rectPos=wait(rect_h);
% do the rest jobs
...
...
end
I use "while(flag)" to run the loop until user presses a cancel button. If the cancel button is pressed, the flag is set to false. But the code still stays at
rectPos=wait(rect_h);
until user double clicks to confirm the rectangle.
Any good way to terminate the wait function and escape the while loop by pressing just one cancel button?
Thank you for your help in advance.
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!