scroll bar does not work when dialog box appears in app designer

5 vues (au cours des 30 derniers jours)
MakM
MakM le 18 Avr 2022
Réponse apportée : Voss le 18 Avr 2022
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

Réponse acceptée

Voss
Voss le 18 Avr 2022
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

Plus de réponses (0)

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by