Uigetfile will make app be behind another windows.

조회 수: 16 (최근 30일)
Shao-Qi Lei
Shao-Qi Lei 2016년 12월 21일
답변: Onur Ozdemir 2022년 3월 14일
I use APP Designer to make a App figure. I want to load my file and display its name,so I use uigetfile. But used uigetfile will make my figure be behind another windows, I have to click it in Taskbar again. Why is this so?

채택된 답변

Ajay Kumar
Ajay Kumar 2019년 11월 20일
add these lines after uigetfile
drawnow;
figure(app.UIFigure)
assuming your UIFigure's name is app.UIFigure

추가 답변 (4개)

Melaku Eneayehu
Melaku Eneayehu 2018년 2월 20일
add the following two lines of code just after uigetfile() app.UIFigure.Visible = 'off'; app.UIFigure.Visible = 'on';
don't forgot to edit figure per-fix if you don't use the default one

Riyadh Abbas
Riyadh Abbas 2017년 5월 26일
Hi there, I found a solution to this issue provided by http://undocumentedmatlab.com/blog/solving-a-matlab-hang-problem, which suggested adding two lines drawnow; pause(0.05);
I tried it and it did work for me, hope can solve your problem.
  댓글 수: 2
Petar Lambrev
Petar Lambrev 2017년 6월 12일
drawnow; pause(0.05); Does not work for me. After closing get file window, the main app window is in the background.
Chris McRaven
Chris McRaven 2017년 6월 16일
This does not work for me either. I have described my steps to reproduce here.

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


Matthew Thomas
Matthew Thomas 2019년 11월 18일
It does seem to be unintended behaviour though, it is frustrating to need to work around this.

Onur Ozdemir
Onur Ozdemir 2022년 3월 14일
All given answers address getting the app window back as focus after uigetfile but what is preferred is to prevent it from minimizing in the first place. You can check out my answer to this question here, which is the same question.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by