macOS compiled application docker icon is not set correctly for uifigure
Show older comments
I am using the Application Compiler APPS to build our application on both mac (mac also uses compiler.package.installer)and windows. We now have a mixture of figure and uifigures for the different tools in the application. When the application is compiled, installed, and opened on macOS Ventura the uifigure figures have the matlab icon on the Docker bar instead of our icon (orange with squiggles). Figure based figures do work correctly. I had to implement the following code from this answer to get the uifigure icons correct on the windows computer, but on mac it is still broken. I have tried using both .ico and icns images for the icon, with the same result.
hUIFig = uifigure; % allow this to load first (run it separately from the below code)
% Find the CEF window for the running app's figure: this idea
% comes from DesktopFigureService MALTAB internal class (courtesy)
cefWindowList = matlab.internal.webwindowmanager.instance.windowList;
url = matlab.ui.internal.FigureServices.getFigureURL(hUIFig);
[idx] = arrayfun(@(ww)strcmp(url,ww.URL), cefWindowList);
hWin = cefWindowList(idx);
hWin.Icon = which('your-icon.ico'); % must be ico file
From <https://www.mathworks.com/matlabcentral/answers/499810-how-can-i-change-the-title-bar-icon-of-my-app>

Accepted Answer
More Answers (0)
Categories
Find more on Get Started with MATLAB Compiler SDK 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!