How can I change the icon of my AppDesigner-produced GUIs?

44 visualizaciones (últimos 30 días)
Micke Malmström
Micke Malmström el 19 de Mzo. de 2018
Editada: li li el 11 de Dic. de 2021
I would like to easily distinguage my GUI from the figures when pressing Alt+Tab so I can access it faster. Now when I run the GUIs they have the same icon as a regular figure...
  4 comentarios
Marc McLean
Marc McLean el 19 de Abr. de 2019
How do you change the icon in the upper left of the .mlappp GUI launched from AppDesigner?
icon.jpg

Iniciar sesión para comentar.

Respuesta aceptada

Cris LaPierre
Cris LaPierre el 29 de Oct. de 2020
Starting with R2020b, you can now specify custom icons for UI figure windows and toolbar push and toggle tools. See the release notes here.

Más respuestas (3)

li li
li li el 11 de Dic. de 2021
Editada: li li el 11 de Dic. de 2021
R2020b OR Last version
function startupFcn(app)
app.uifigure .Icon='logo.png';
end
OK!

Cris LaPierre
Cris LaPierre el 20 de Abr. de 2019
Editada: Cris LaPierre el 29 de Oct. de 2020
R2020b update: See this answer.
  1 comentario
Micke Malmström
Micke Malmström el 5 de Mzo. de 2020
Note that I dont want to change the icon of the Matlab application (which "this answer" says you cant and which is understandable). I only want to change the icon of one particular figure window, so that I can find it easily when I have >25 figures open at the same time.

Iniciar sesión para comentar.


Robert
Robert el 29 de Oct. de 2020
Add this to your startupFcn:
t = 0;
tMax = 5;
dt = 0.1;
while ~isfield(struct(struct(app.UIFigure).Controller), 'PlatformHost') && t < tMax
% Keep waiting until the window is found.
t = t + dt;
pause(dt)
end
win = struct(struct(struct(app.UIFigure).Controller).PlatformHost).CEF;
win.Icon = 'C:\Folder\MyIcon.ico';
Of course, you may have renamed the UIFIgure property of your app.
In R2016b and older, replace 'PlatformHost' with 'Container'.

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by