As of R2025ab, are all figures now uifigures?
83 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Matt J
el 14 de Nov. de 2025 a las 4:07
Comentada: dpb
el 16 de Nov. de 2025 a las 17:48
Prior to R2025, the result of the code below was tf=0. Have the figure and uifigure frameworks been unified somehow? Is that why tf is now 1?
fig=figure; plot(1:5);
tf = matlab.ui.internal.isUIFigure(fig)
2 comentarios
dpb
el 14 de Nov. de 2025 a las 17:46
Editada: dpb
el 14 de Nov. de 2025 a las 18:01
hF=figure
That looks like a regular figure given that it has a number; for uifigures the .Number property has always been empty.
What does
hUF=uifigure
return?
By default, the .IntegerHandle' property is 'on' for regular figures and 'off'' for UIFigures. As well 'HandleVisibility' is the same set of default properties so gca won't find a UIFigure, but will create a regular figure if one doesn't exist.
dpb
el 14 de Nov. de 2025 a las 19:37
What happens with
fig=figure;
hBtn=uibutton(fig);
? If it's a regular figure, this will fail.
Respuesta aceptada
dpb
el 14 de Nov. de 2025 a las 18:46
Movida: dpb
el 14 de Nov. de 2025 a las 18:47
This appears to be a result of the replacement of Java for rendering...
which -all matlab.ui.internal.isUIFigure
fn=which('matlab.ui.internal.isUIFigure');
type(fn)
hF=figure;
hF.JavaFrame_I
hUF=figure;
hUF.JavaFrame_I
By comparison, with release prior to R2025, the results are:
>> hF.JavaFrame_I
ans =
com.mathworks.hg.peer.HG2FigurePeer@f14e5bf
>> hUF.JavaFrame_I
ans =
[]
>>
Now whether this is an oversight on Mathworks' part in not making a change here or not I don't know, but it does seem like a reasonable query.
6 comentarios
dpb
el 16 de Nov. de 2025 a las 17:48
Interesting. With so much revision in the desktop and that I have a quite slow connection I've not yet installed R2025x.
I guess then this case would resolve to test a version if you have to support anything other than latest.
I haven't tried it, but I was thinking it might be interesting to grep the string 'isUIFigure' and see just where (in visible code at least) it might be being used and for what kind of branching, maybe.
I've been since the initial introduction and am still curious about what the really longterm intent is with having the two--will the venrable figure eventually morph into the other and simply become redundant syntax for the same thing, maybe?
Más respuestas (0)
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
