Force GUI to resume from outside

1 view (last 30 days)
Lorenzo on 4 Feb 2014
Edited: Lorenzo on 4 Feb 2014
Dear all, I have a gui which starts on wait (uiwait(handles.figure)). This is totally ok as long as the user is interacting with it. Now, a problem comes when this gui is called from another gui to perform some operations. Since the gui starts on wait it blocks the execution of the rest of the script.
Of course I cannot call the GUI and then use resume right after since the program will not get to the resume line.
Is there any way to force the gui to resume anyways?
Lorenzo on 4 Feb 2014
Thank you for your question. My gui can work in 2 ways:
1. Called by the user from a main gui via a=myGui. The gui is started with wait and when the user closes it it is resumed and the output is passed to the main gui
2. The user can load a configuration file from the main gui. In this case, I need to open the secondary gui in order to create the handle structure, the the program reads the configuration file and set the handles. Now, since the gui is waiting, my program doesn't get to setting the handles.
Now, unless someone can think of a better solution, what I had in mind is:
1. call the gui with a=myGui(waitOnStart) and depending on the value of waitOnStart set it to wait or not using an if statement
2. Remove the uiwait bit and set the output of the gui as one of the handle fields and on closing pass that to the main gui.
What do you think?
Thanks again.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 4 Feb 2014
Perhaps provide a "Continue" button such as in the example in uiwait()
If you really needed to, start a timer object that will do a uiresume() when it fires.
  1 Comment
Lorenzo on 4 Feb 2014
Edited: Lorenzo on 4 Feb 2014
Thanks for your answer Walter. Please have a look at the answer I gave above to Shivaputra Narke.
To that extent:
1. A "continue" button would require an action from the user and that is not doable when loading the configuration file
2.A timer is not doable either as that would resume the gui when used in the first mode, ie when the user is interacting with it.
Thanks again for your help!

Sign in to comment.


Find more on Interactive Control and Callbacks 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!