stop minimizing GUI window after file selection through dialog window

My GUI has the user browse/create an excel file through the dialog window. Once the file is selected or created and the user hits ok, the dialog window is closed but it automatically minimizes the running GUI tab. Why does this happen and what changes do i make so that the gui tab does not minimize?

 Akzeptierte Antwort

dpb
dpb am 2 Aug. 2023
Bearbeitet: dpb am 3 Aug. 2023
See <LongStandingProblemThread>. This has been a bug for "since forever". There are some workarounds at the referenced link; you can experiment with which version seems to work best for your app. I've observed the same thing doesn't necessarily work well with a given app project, but each project seems to behave the same way consistently, so I've used different permutations at different times. What is the difference between those I've had no success whatsoever at being able to ascertain; the code sequence is the same, even to the point of one app having been copied from another with only an external final function code being the real difference, the GUI part of the two apps is essentially a carbon copy one of the other with very little different (the labels on text fields and an additional check box) yet consistently the behavior when the file dialog was called had somewhat different charatersitics regarding who was left in focus. Then, sometimes it seems as though nothing, even the close/reopen figure works to return the actual focus, only manually clicking again on the app window does although it does bring the figure back to foreground so can do so.
Why TMW can't/won't/doesn't commit resources and fix this is beyond pale...it's extremely frustrating to use the app when it acts this way (and even more so that one can't find a way to fix the behavior).

2 Kommentare

the first solution in the thread worked for me:
f = figure('Renderer', 'painters', 'Position', [-100 -100 0 0]); %create a dummy figure so that uigetfile doesn't minimize our GUI
[filename,path] = uigetfile('*.txt', 'Open text file','MultiSelect','on');
delete(f); %delete the dummy figure
again, thanks for the help
Glad it worked...if you build more apps with App Designer, you're bound to be back to the page looking at other pieces...unless and until TMW actual fixes the underlying problem such that the focus be returned to the calling figure after the call.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu App Building finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2023a

Gefragt:

am 2 Aug. 2023

Kommentiert:

dpb
am 3 Aug. 2023

Community Treasure Hunt

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

Start Hunting!

Translated by