AppDesigner Error "Functionality not supported with figures created with the uifigure function" only when opening distributed .exe on other devices.
Ältere Kommentare anzeigen
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 Kommentare
Kevin Holly
am 21 Jun. 2022
Bearbeitet: Kevin Holly
am 21 Jun. 2022
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
am 21 Jun. 2022
Bearbeitet: Michael Sudol
am 21 Jun. 2022
Kevin Holly
am 21 Jun. 2022
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
am 22 Jun. 2022
Antworten (0)
Kategorien
Mehr zu Install Products finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!