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?

 採用された回答

dpb
dpb 2023 年 8 月 2 日
編集済み: dpb 2023 年 8 月 3 日

0 投票

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 件のコメント

Roshan Patel
Roshan Patel 2023 年 8 月 2 日
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
dpb
dpb 2023 年 8 月 3 日
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.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeApp Building についてさらに検索

製品

リリース

R2023a

質問済み:

2023 年 8 月 2 日

コメント済み:

dpb
2023 年 8 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by