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

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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품

릴리스

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