scroll bar does not work when dialog box appears in app designer
조회 수: 3 (최근 30일)
이전 댓글 표시
I am attaching the code, which is used to read the text files from the directory. whenever the dialog box appears the scroll bar as shown in the image freezes, is there any way i can scroll the text file names along with the dialog box open. Image and code attached.
properties (Access = private)
txt_files
txt_DIR
txt_file_bas
end
methods (Access = private)
% Button pushed function: UploadFilesButton
function UploadFilesButtonPushed(app, event)
app.txt_DIR = 'C:\Users\Windows 10\Documents\samples\';
app.txt_files = dir([app.txt_DIR '*.txt']);
b={app.txt_files(:).name}';
app.TextArea.Value=app.txt_DIR ; % Sets the label text to be the selected path
b(ismember(b,{'.','..'})) = []; % Removes unnecessary '.' and '..' results from the display.
for txt_i = 1:length(app.txt_files)
s_no{txt_i}=(txt_i);
end
s_no=s_no';
app.UITable.Data=[s_no b]; % Displays the directory information to the UITable.
txt = inputdlg('Enter text value',...
'Enter text value', [1 50]);
end
% Value changed function: TextArea
function TextAreaValueChanged(app, event)
value = app.TextArea.Value;
end
end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/967720/image.png)
댓글 수: 0
채택된 답변
Voss
2022년 4월 18일
inputdlg creates a modal dialog box. "Modal" means that no other window can be interacted with while the modal window is up.
To allow interacting with other windows while the inputdlg window is up, you can make the inputdlg non-modal:
txt = inputdlg( ...
'Enter text value', ... % prompt
'Enter text value', ... % title
[1 50], ... % dimensions of edit field
{''}, ... % default answer
struct('WindowStyle','normal')); % options
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!