Clear Filters
Clear Filters

Exception at showing volshow() in AppDesigner

7 views (last 30 days)
rocketMan
rocketMan on 10 Nov 2020
Commented: rocketMan on 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);

Answers (1)

Cris LaPierre
Cris LaPierre on 10 Nov 2020
Edited: Cris LaPierre on 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 Comments
Cris LaPierre
Cris LaPierre on 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 on 11 Nov 2020
I mean the same script, but an another machine

Sign in to comment.

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!