Menu is not closing

3 views (last 30 days)
Michael Lee
Michael Lee on 5 Jul 2013
In the code, I create a pop-up menu when the process has been done in the past, asking the user if they want to re-run the code or load the past results. The code is:
if exist(JID_filename, 'file') == 2
run_choice = menu('It looks like this sweep has already been done.', 'Use Old Data', 'Re-run It');
if run_choice == 1
initial_decision = 3.1415926;
end
end
For some reason, when the user clicks on one of the buttons, the code works, but the menu does not go away. Is there any way to make the menu close automatically without the user having to press the close button?

Answers (1)

Jan
Jan on 7 Jul 2013
This sounds strange. Does it help to insert a drawnow after the menu call? Or did you shadow the builtin delete command by a user-defined version, which does not delete the figure? See:
which delete
  2 Comments
Michael Lee
Michael Lee on 8 Jul 2013
drawnow did the trick, thanks a lot!
Jan
Jan on 8 Jul 2013
Then this means, that the figure has been deleted, but the update of the screen has not been triggered. DRAWNOW starts this update manually.

Sign in to comment.

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!