guide - interrupt ongoing callback and switch to correct callback when user clicks another button

1 view (last 30 days)
I am creating a GUI to draw shapes on a figure with different kind of shapes (ellipse, polygone,...) and different shape fillings (black, white,...). I separated shapes and filling in two group buttons each containing the options. When the user clicks on one type of filling and starts drawing on the figure it works. But when the user decides to change the shape it does not work. How can I interrupt the ongoing callback as soon as the user decides to use another tool and start the new callback? In other words, how to know at each moment the status of all the buttons and do the callback accordingly? I am a bit lost with the options I have: interruptible, busy action, waitfor, drawnow. Suggestions welcome. Thanks.

Answers (1)

Sean de Wolski
Sean de Wolski on 10 Jun 2011
One thought: use timers and stop the timer when the second button is pushed.
doc timer
doc start
doc stop

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!