How can I change the title bar icon of my app?

205 views (last 30 days)
In license agreement it is said:
3.1. MATLAB Compiler
vi) You may not modify or remove any proprietary notices included with Programs or Program Components. However, you are permitted to remove the MathWorks logo icon within the figure title bar of your Application and replace it with a different icon.
But how can I do that? There is an option in the compiler to add an icon, but when the app is opened, the Mathworks logo is displayed.
I am using App Designer, so the javaframe option is not available.
  2 Comments
PierreC
PierreC on 7 May 2020
+1 as well ... This is pretty annoying, especially when you'd want to use different icons for different app windows (in order to identify them quickly).

Sign in to comment.

Accepted Answer

Isaac Marín
Isaac Marín on 14 May 2020
  2 Comments
Isaac Marín
Isaac Marín on 14 May 2020
Is the aswer referenced in the link, it uses a custom function called "getWebWindowOfUiFigure", and it works to change the icon.

Sign in to comment.

More Answers (3)

Cris LaPierre
Cris LaPierre on 29 Nov 2020
Starting with R2020b, there is now an icon property. You can use it to "specify custom icons for UI figure windows and toolbar push and toggle tools". You can see more under "App Building" in the release notes for R2020b.
To specify a custom icon, set the Icon property value to an image file or an m-by-n-by-3 truecolor array. See here in the UIFigure Properties.

Ganesh Regoti
Ganesh Regoti on 14 Jan 2020
  1 Comment
Isaac Marín
Isaac Marín on 14 Jan 2020
The link doesn't have a solution for this problem, i'm using MATLAB compiler R2019b

Sign in to comment.


Bereketab Gulai
Bereketab Gulai on 19 Jun 2020
Here is the real solution R2019b and above:
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
  2 Comments
Bereketab Gulai
Bereketab Gulai on 22 Jun 2020
Even when the app is deployed you can use
which('myIcon.ico');
making sure that the icon is included in the resources list in the compiler.
  • I did not understand about the "Windows still clusters the App along with other Matlab 2019b windows, even when deployed. ". It would be good to see a picture or illustration, more description.
  • Do you mean the windows on the taskbar show under the other RUNNING MATLAB APPs? If so, probably there is no solution to this, probably MATLAB apps of the same version (R2019b...) probably have something in common while running, thus windows groups as so. You could post a question about that in case some experts have a solution.

Sign in to comment.

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by