AppDesigner Error "Functionality not supported with figures created with the uifigure function" only when opening distributed .exe on other devices.
이전 댓글 표시
I am having an issue where my GUI crashes a few seconds afler opening on other devices. This only occurs when the packaged .exe is opened on devices other than my own, both when Runtime is preinstalled or installed upon opening. The error "Functionality not supported with figures created with the uifigure function" is stated to occur when my startupFcn, shown below, attempts to run. What could be causing this issue? The GUI works 100% fine on my device when run either directly from AppDesigner or from the .exe. It also works fine when the code si run from AppDesigner on other machines.
% Fix window sizing bugs
warning off MATLAB:ui:uifigure:UnsupportedAppDesignerFunctionality
set(0,'units','pixels');
Pix_SS = get(0,'screensize');
k_vert=Pix_SS(4)/1080;
k_hor=Pix_SS(3)/1920;
%k_vert=0.75;
%k_hor=0.6;
uisize = app.UIFigure.Position;
screenWidth = uisize(3);
screenHeight = uisize(4);
left = uisize(1);
bottom = uisize(2);
width = screenWidth*k_hor;
height = screenHeight*k_vert;
k_font=(k_hor+k_vert)/2;
drawnow;
comp=app.UIFigure.Children;
app.UIFigure.Position = [left bottom width height];
assignin('base', 'pos', app.UIFigure.Position);
assignin('base', 'compp', app.UIFigure.Children);
for i=1:numel(comp)
app.UIFigure.Children(i).Position(3)=comp(i).Position(3)*k_hor;
app.UIFigure.Children(i).Position(4)=comp(i).Position(4)*k_vert;
app.UIFigure.Children(i).Position(1)=comp(i).Position(1)*k_hor;
app.UIFigure.Children(i).Position(2)=comp(i).Position(2)*k_vert;
try
a{i} = comp(i).FontSize;
catch
warning('This object does not have font option. Assigning a value of 0.');
a{i} = 0;
end
if a{i}~=0
app.UIFigure.Children(i).FontSize=comp(i).FontSize*k_font;
end
end
댓글 수: 4
Kevin Holly
2022년 6월 21일
편집: Kevin Holly
2022년 6월 21일
Does the other device have a different Operating System or is one 32-bit vs 64-bit?
"Standalone applications run on Windows®, Linux®, and macOS corresponding to the platform on which they are generated."
Michael Sudol
2022년 6월 21일
편집: Michael Sudol
2022년 6월 21일
Kevin Holly
2022년 6월 21일
Were you able to compile other apps to a standalone executable and succesfully run it on other devices with the same operating system?
Michael Sudol
2022년 6월 22일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!