필터 지우기
필터 지우기

How to make uigetfile window pops-up in front of my app (designed in appdesigner)?

조회 수: 34 (최근 30일)
Toey
Toey 2020년 4월 18일
답변: Jorg Woehl 2024년 5월 14일
Hi Guys,
I use uigetfile to load a file in my app. But its window always ends up behind my app figure. I have tried a couple of solutions suggested in previous threads e.g. using drawnow, but it didn't work. I'm using matlab 2020a.
Is there a way to make uigetfile window show up on top of my app figure without turning my figure off/on?
I would be very grateful if you could share some works around this issue.
Best,
Toey
  댓글 수: 5
Earl Vickers
Earl Vickers 2020년 12월 14일
I have the same problem with 2020b on Mac.
Mario Malic
Mario Malic 2020년 12월 14일
I can't find the original question where the workaround for this was posted, but write this after uigetfile or uigetdir
drawnow;
figure(app.ApplicationUIFigure); % replace this with your app handle

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

답변 (2개)

Geoff Martin
Geoff Martin 2023년 8월 10일
I'm having exactly the same problem (with uiopen instead of uigetfile) - and the suggested solution seems to do the opposite of a fix.
The uigetfile pop-up pops up BEHIND the app window. So, if you don't know it's there, you won't go looking for it.
the only work-around I've found so far is to make the entire app window invisible (in my case, it's just app.UIFigure)
app.UIFigure.Visible = 'off';
uiopen('load');
app.UIFigure.Visible = 'on';
But this is obviously not very elegant.
Is there a way to move the uigetfile/uiopen window in front of the app window?

Jorg Woehl
Jorg Woehl 2024년 5월 14일
I have just published a simple workaround for these focus issues, which -- as The MathWorks acknowledges -- still have "currently no official workaround". Check out my File Exchange contribution https://www.mathworks.com/matlabcentral/fileexchange/165961-fixfocus.

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by