Force GUI to resume from outside

2 ビュー (過去 30 日間)
Lorenzo
Lorenzo 2014 年 2 月 4 日
編集済み: Lorenzo 2014 年 2 月 4 日
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?
Thanks!
Lorenzo
  2 件のコメント
Shivaputra Narke
Shivaputra Narke 2014 年 2 月 4 日
How your gui works when you run it i.e. not invoking through other function or gui. And how do you work on it?
Lorenzo
Lorenzo 2014 年 2 月 4 日
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.

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2014 年 2 月 4 日
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 件のコメント
Lorenzo
Lorenzo 2014 年 2 月 4 日
編集済み: Lorenzo 2014 年 2 月 4 日
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!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by