MATLAB Answers

How to move an app (in appdesigner) to a new directory and handle icons (png files) on push buttons

13 views (last 30 days)
Jason
Jason on 7 Oct 2020
Edited: Mario Malic on 8 Oct 2020
Hello, Appdesigner allows you to add Icons to buttons.
My question is, if I want to copy my App to a different name in a different directory and I've already added icons (png) to pushbuttons I don't want the new app to point to the original picture files for the icons. If I just drop these icons in the new directory, will I have to selecvt each button and re assign the icon in the new directory?
Thanks
Jason

  0 Comments

Sign in to comment.

Accepted Answer

Mario Malic
Mario Malic on 7 Oct 2020
Edited: Mario Malic on 7 Oct 2020
If you want to move your app in different folder, you can create a folder with icons and add it to the MATLAB path and the icons will always remain there wherever you move the app.
You can move also your images to the same folder with the app, as paths to the images can be relative, but it's not a tidy solution.

  4 Comments

Show 1 older comment
Mario Malic
Mario Malic on 7 Oct 2020
Then use relative paths for images, in the folder where your app is, make folder with images and add the folder to the path.
Click on all buttons, and type in the relative path to the image to the Icon field, i.e. Icons\im1.png
Maybe some of icons have relative path, you can check that in the Code view in function
function createComponents(app)
Jason
Jason on 7 Oct 2020
Yep all the icons are just showing their filename with no path, so I assume these are all relatative.
Mario Malic
Mario Malic on 7 Oct 2020
If you have a separate folder with pictures for each application, you should be good to go
Edit for clarity: If you have a separate folders for each application, and pictures within the each folder, you should be good to go

Sign in to comment.

More Answers (0)

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by