Clicking app button moves app behind Matlab's main window.

조회 수: 3 (최근 30일)
Travis Meyer
Travis Meyer 2022년 10월 30일
편집: Jan 2022년 10월 30일
I made an app button that loads a datafile with uigetfile. It works, but after clicking on the file, my app window moves behind the main Matlab window. There must be a way to keep my app in front of Matlab after executing a callback. Callback code is based on the example:
% Display uigetfile dialog
filterspec = {'*.nev;*.dat;','All Data Files'};
[f, p] = uigetfile(filterspec);
% Make sure user didn't cancel uigetfile dialog
if (ischar(p))
fname = [f];
app.EditField.Value = fname;
end
  댓글 수: 1
Jan
Jan 2022년 10월 30일
Just a note: I get the file name and the path in uigetfile. Then use the path:
[f, p] = uigetfile(filterspec);
if ischar(p)
app.EditField.Value = fullfile(p, f);
end
This sets a field to the specified value, but does not load a file.

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

답변 (1개)

Jan
Jan 2022년 10월 30일
편집: Jan 2022년 10월 30일

카테고리

Help CenterFile Exchange에서 App Building에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by