Setting UIFigure windowstyle to modal

17 vues (au cours des 30 derniers jours)
Alejandro Alonso Canales
Alejandro Alonso Canales le 24 Nov 2020
Commenté : Emmanuel Cherin le 23 Fév 2022
Hello i have been looking for a couple of days for answer to this but so far no luck.
According to this link: UIFigure I can set the windowstyle property of a UIFIgure to modal.
But when I try on code:
%------fig--------
try
fig = uifigure;
fig.Name = 'Enter Background Gas Value';
fig.Resize = 'off';
fig.Position(1:2) = [400, 300];
fig.Position(3:4) = [800, 500];
fig.WindowStyle = 'modal';
catch ME
disp(ME)
end
i get this error:
MATLAB:ui:uifigure:UnsupportedAppDesignerFunctionality
Functionality not supported with figures created with the uifigure function. For more information, see Graphics Support in App Designer.
Any idea what i am doing wrong? Thank you

Réponse acceptée

Sarvani Panguluri
Sarvani Panguluri le 27 Nov 2020
Modifié(e) : Sarvani Panguluri le 27 Nov 2020
Hi,
The WindowStyle property is new and has been made available from MATLAB R2020b .So,in case you are using a version prior to that,it would cause error.You can check the Release Notes to know all the new and updated features.
Hope this helps!
  2 commentaires
Alejandro Alonso Canales
Alejandro Alonso Canales le 27 Nov 2020
Thank you. Do you know any workaround for previous versions?
Emmanuel Cherin
Emmanuel Cherin le 23 Fév 2022
The WindowStyle property is actually not new. In version of Matlab prior to R2020b, it is accessible for figure objects generated by a call to 'figure', or to GUI figures generated using GUIDE. For figures generated by a call to 'uifigure' or using appdesigner, only some of their properties can be changed (look for " UI Figure (App Designer) Properties" in Matlab help)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Develop uifigure-Based Apps dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by