Exception at showing volshow() in AppDesigner
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello, I always get an exception when I try to put a created via volshow() figure into an Appdesigner. Does anyone know how to fix it?
The exception: Update traversal encountered invalid scene tree.
The code:
app.Panel = uipanel(app.GridLayout);
h=volshow(BW, 'parent',app.Panel);
0 Kommentare
Antworten (1)
Cris LaPierre
am 10 Nov. 2020
Bearbeitet: Cris LaPierre
am 10 Nov. 2020
"The volshow function creates a uipanel object in the specified parent figure."
I believe the issue is because volshow does not support uifigures, which is what is used in app designer. Try the following in MATLAB. I get the same error message you report with the uifigure example.
% Load a demo volume
load('spiralVol.mat');
% Works
f = figure;
volshow(spiralVol, 'parent',f);
% doesn't work
uf = uifigure;
volshow(spiralVol, 'parent',uf);
It does work with a uipanel, even if that uipanel is placed on a figure. However, not with a uifigure
p = uipanel;
volshow(spiralVol, 'parent',p);
f=figure;
fp = uipanel(f,'Title','Main Panel','FontSize',12,...
'BackgroundColor','white',...
'Position',[.25 .1 .67 .67]);
volshow(spiralVol, 'parent',fp);
% doesn't work, but no error
uf=uifigure;
ufp = uipanel(uf,'Title','Main Panel','FontSize',12,...
'BackgroundColor','white',...
'Position',[.25 .1 .67 .67]);
volshow(spiralVol, 'parent',ufp);
3 Kommentare
Cris LaPierre
am 11 Nov. 2020
It seems to not support uipanels when they are placed on uifigures. The canvas in app designer is a uifigure.
What do you mean by your other notebook? Is that another app or a live script?
Siehe auch
Kategorien
Mehr zu Downloads finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!