How to use dialog boxes
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi all,
Hope anyone can clear this up to me. Following the document:
What if I want to produce a dialog box without a figure fig below?
Or just resize the figure to be the equal to the dialog box. I've tried looking at the figure properties but found nothing about the size of the window.
Thanks!
0 Commenti
Risposte (1)
Rahul
il 20 Gen 2025
According to the steps given in the following documentation: https://it.mathworks.com/help/matlab/creating_guis/update-dialog-boxes.html
If you open a dialog box while creating an app, then the dialog box gets created within the 'uifigure' of the App.
If you require to produce the dialog box and not see the figure of the App below, you can use 'set' function on the 'Visible' property of the 'app.UiFigure'. Here is an example which I have added to a 'ButtonPushed' callback of an App:
function ButtonPushed(app, event)
set(app.UIFigure,'Visible', 'off');
e = errordlg("Operation unsuccessful","Error");
uiwait(e);
set(app.UIFigure,'Visible', 'on');
% close(app.UIFigure); Use 'close' function if the App is required to
% be closed
end
Also, a dialog box can be created without creating an App. Hence if the workflow does not require creation of an App's Figure, then dialog boxes can directly be created using functions like 'errordlg', 'warndlg' etc anywhere in a MATLAB file. Here is an example:
warndlg("This operation cannot be undone","Warning");
Refer to the following MATLAB documentations to know more:
'Figure Properties': https://www.mathworks.com/help/releases/R2022a/matlab/ref/matlab.ui.figure-properties.html
Hope this helps! Thanks.
0 Commenti
Vedere anche
Categorie
Scopri di più su Startup and Shutdown in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!