필터 지우기
필터 지우기

Problem with selecting location in appdesigner

조회 수: 1 (최근 30일)
Mahdi Hayati
Mahdi Hayati 2023년 7월 9일
편집: Mahdi Hayati 2023년 7월 10일
Hi
I am developing an app with appdesigner. one part of it, I have a button that when user clicks on it, a window opens to select a location from his/her PC to save files. This is the code I have written for it:
app.callingapp.path = uigetdir;
The problem is whenever I push this button, after I choose location and push OK, instead of closing the dialog window and go back to the main app window, it jumps into another window which is open in my desktop. For example if there is a Word file or PDF file open, it jumps into that.
Does anyone know how to fix it?

채택된 답변

Sandeep Mishra
Sandeep Mishra 2023년 7월 9일
Hello Mahdi,
I understood that you want to keep your app window in front after using uigetdir.
To resolve this issue, You can refer the below MATLAB answer.
Feel free to put any comments if you face any issue.
  댓글 수: 1
Mahdi Hayati
Mahdi Hayati 2023년 7월 10일
편집: Mahdi Hayati 2023년 7월 10일
Thank you. it worked!
But has a small problem...:
if I try to invisible the dummy figure after creating it, that wont work.
I just made it as small as possible such that user won't notice it!

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

추가 답변 (1개)

Deep
Deep 2023년 7월 9일
I am able to replicate this issue and tried looking for ways to make it work. As a simple workaround, you can change the focus to the main app window after uigetdir finishes.
app.callingapp.path = uigetdir;
figure(app.UIFigure); % Change focus to your application
  댓글 수: 1
Mahdi Hayati
Mahdi Hayati 2023년 7월 10일
Thank you for your answer, it works, but has a little problem:
User can see that in a very short time, another window opens and again UIFigure goes on top

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

카테고리

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