How to detect whether a figure is created by uifigure()
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Matt J
il 28 Gen 2024
Commentato: Walter Roberson
il 28 Gen 2024
I have the following in my startup.m file,
set(groot,'defaultFigureCreateFcn',@(fig, ~)addToolbarExplorationButtons(fig));
which throws an error when a uifigure is created,
fig = uifigure;
Error using matlab.ui.Figure/set
Functionality not supported with figures created with
the uifigure function.
So, the question becomes, how can I pre-detect whether fig has been created by uifigure() as opposed to figure()? There don't appear to be separate classes reserved for the two,
>> class(figure)
ans =
'matlab.ui.Figure'
>> class(uifigure)
ans =
'matlab.ui.Figure'
0 Commenti
Risposta accettata
Bruno Luong
il 28 Gen 2024
This command sreturns true for uifigure handle fig
matlab.ui.internal.isUIFigure(fig)
2 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Develop uifigure-Based Apps 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!