Filter löschen
Filter löschen

Exception at showing volshow() in AppDesigner

7 Ansichten (letzte 30 Tage)
rocketMan
rocketMan am 10 Nov. 2020
Kommentiert: rocketMan am 11 Nov. 2020
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);

Antworten (1)

Cris LaPierre
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
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?
rocketMan
rocketMan am 11 Nov. 2020
I mean the same script, but an another machine

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Develop Apps Using App Designer 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!

Translated by