How to switch between two buttons with callbacks being impoly and imellipse respectively
Info
This question is closed. Reopen it to edit or answer.
Show older comments
I created two toggle buttons in a figure, one button's callback is impoly and another one is imellipse. I click the impoly button and then the imellipse button. The ideal is that the impoly callback is cancelled and the imellipse is implementing. But how to do that? Usually what I do is to have the third botton to fire an 'ESC' to cancel the clicked button and then move to the button wanted, which is not an elegant way. I tried to debug the matlab's switch between 'zoomin' and 'zoomout'. It seems the switch is dealed within its built-in functions.
Thank you!
Answers (2)
Image Analyst
on 28 May 2013
0 votes
Why can't you just issue the escape immediately upon entering the callback? Even if you're not in the middle of drawing something are there any bad side effects of issuing an unnecessary escape?
2 Comments
Jun Li
on 29 May 2013
Image Analyst
on 29 May 2013
Call the Mathworks or ask Yair. But what I'd do is to disable the two buttons and just throw up some text with instructions that say to right click or type escape to abort. Then when your code continues, you can recognize that they aborted because the coordinates will not be right, and then you enable the two buttons again.
Somebody was able to solve this problem? Thank you so much in advance!
This question is closed.
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!