uistack on opening function

2 Ansichten (letzte 30 Tage)
Stephen
Stephen am 11 Apr. 2017
Kommentiert: Stephen am 11 Apr. 2017
I have two GUIs that have structures linked between. When the second GUI is opened, if a certain variable is not available, I want it to return the user to the first GUI.
I tried using uistack at the end of the 2nd GUI opening function, it brings the 1st GUI to the front very briefly then defaults back to the 2nd GUI.
Here is the process logically: 1. First GUI is opened. 2. Second GUI is opening, data from first GUI is loaded. 3. Variable is missing, active figure changed back to first GUI.

Akzeptierte Antwort

Adam
Adam am 11 Apr. 2017
Bearbeitet: Adam am 11 Apr. 2017
figure( hFirstGUI );
should work if placed in the Output_Fcn of the 2nd GUI, should work I think. 'hFirstGUI' being the handle of your first GUI which you would need to pass in to the 2nd GUI. The Opening_Fcn builds the GUI and when it reaches the end gives focus to that GUI so if you try to change focus within the Opening_Fcn it will just be overridden when it completes.
The Output_Fcn gets run afterwards. If you have a Modal GUI with a uiwait setup this will not work though as the Output_Fcn will not run until the uiresume.
  1 Kommentar
Stephen
Stephen am 11 Apr. 2017
Output_Fcn is exactly what I needed, thanks.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by