Thread Subject: Renaming a gui

Subject: Renaming a gui

From: Yoav

Date: 23 Sep, 2009 18:43:09

Message: 1 of 7

Hi,

My problem is related to changing the name of a GUI file.

I was working on making a GUI interface via GUIDE, lets call it A. There are two files in the process, A.fig (the GUI part) and A.m, the code related to the different events and functions in the GUI.

As I was developing it I was using the name A (which is a temporary name) but now that it is done I want to call it something different which represents the final version, lets say F (for Final). I changed both file names (A.fig and A.m became F.fig and F.m) as well as the actual function name inside the F.m file.

Now I found a bug in my GUI and I went to the F.m file to fix it. When I then run mu GUI from matlab by writing
F
in the command window it still has the bug, even though it is fixed in the F.m file. I went and fixed it in the A.m file and it works fine.

So, my issue, is, it seems that my "new" F GUI still uses the original A.m file as its code. Even when I put breaks in the F.m file it doesn't break, suggesting it really isn't using the F.m file.

Question: How do I rename a GUI which was made with GUIDE such that it uses a new m file? (and using the "file" menu, "save as" didn't work either...)

Thanks,

Yoav Farkash

Subject: Renaming a gui

From: Nathan

Date: 23 Sep, 2009 18:49:46

Message: 2 of 7

On Sep 23, 11:43 am, "Yoav" <yoav.fark...@utoronto.ca> wrote:
> Hi,
>
> My problem is related to changing the name of a GUI file.
>
> I was working on making a GUI interface via GUIDE, lets call it A. There are two files in the process, A.fig (the GUI part) and A.m, the code related to the different events and functions in the GUI.
>
> As I was developing it I was using the name A (which is a temporary name) but now that it is done I want to call it something different which represents the final version, lets say F (for Final). I changed both file names (A.fig and A.m became F.fig and F.m) as well as the actual function name inside the F.m file.
>
> Now I found a bug in my GUI and I went to the F.m file to fix it. When I then run mu GUI from matlab by writing
> F
> in the command window it still has the bug, even though it is fixed in the F.m file. I went and fixed it in the A.m file and it works fine.
>
> So, my issue, is, it seems that my "new" F GUI still uses the original A.m file as its code. Even when I put breaks in the F.m file it doesn't break, suggesting it really isn't using the F.m file.
>
> Question: How do I rename a GUI which was made with GUIDE such that it uses a new m file? (and using the "file" menu, "save as" didn't work either...)
>
> Thanks,
>
> Yoav Farkash

See what others have tried to link .m files and .fig files.

http://groups.google.com/group/comp.soft-sys.matlab/browse_thread/thread/b6e910dc9c456955/16f59cb7f916c23b?hl=en#16f59cb7f916c23b

Good luck.

-Nathan

Subject: Renaming a gui

From: Yoav

Date: 24 Sep, 2009 15:19:03

Message: 3 of 7

Well, the solution in the thread is true but it is very hard to implement.

Even worse, when you add a new object to the now renamed GUI the new callback is saved in the new name (in my example, adding a new object in F.fig creates a callback in F.m). The problem is that now all the older callbacks are called from A.m while the new ones from F.m and the whole thing is a huge mess, impossible to keep track of changes.

I guess for the time being, my suggestion to users is not to rename their gui files.
Think hard before you start your project how so you want it called and stick to it! :-)

Yoav

Subject: Renaming a gui

From: kenobe

Date: 2 Oct, 2009 12:08:00

Message: 4 of 7

you do not rename the fig or m file.
you simply save the fig using save as ...f.fig. then a f.m file will be generated automatically.

Subject: Renaming a gui

From: Janos Marki

Date: 19 Sep, 2010 15:17:04

Message: 5 of 7

kenobe <alex_kenobe01@yahoo.com> wrote in message <1578863216.2435.1254485310861.JavaMail.root@gallium.mathforum.org>...
> you do not rename the fig or m file.
> you simply save the fig using save as ...f.fig. then a f.m file will be generated automatically.

This only works if you do it via GUIDE (using the saveas(h,'NEWFIGNAME.fig') command as I tried does not create the .m file), but then it does indeed.

Janos

Subject: Renaming a gui

From: Patrick

Date: 1 Feb, 2011 18:30:34

Message: 6 of 7

Anyone have any other ideas? I started a new version of a project by renaming the FIG and M files, now when I start up the new project, it spits out a bunch of these errors:

errors ??? Error using ==> struct2handle
Error while evaluating uicontrol CreateFcn

On startup or if I edit the fig from GUIDE if the old m and fig files aren't around. It seems to work perfectly fine otherwise, but this is a to have to keep the old m and fig files in the same directory.

Subject: Renaming a gui

From: ImageAnalyst

Date: 1 Feb, 2011 22:29:39

Message: 7 of 7

On Feb 1, 1:30 pm, "Patrick " <praph...@gmail.com> wrote:
> Anyone have any other ideas?   I started a new version of a project by renaming the FIG and M files, now when I start up the new project, it spits out a bunch of these errors:
>
> errors ??? Error using ==> struct2handle
> Error while evaluating uicontrol CreateFcn
>
> On startup or if I edit the fig from GUIDE  if the old m and fig files aren't around.   It seems to work perfectly fine otherwise, but this is a to have to keep the old m and fig files in the same directory.

-------------------------------------------------------------
Patrick, reread what you sent. The grammar seems all messed up -
words missing, etc. The method given (doing File/save as... from
GUIDE works. At that point, you can remove the original named files
from the folder and it should work fine with the new name.
ImageAnalyst

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
reaname a gui Sprinceana 24 Sep, 2009 02:43:55
rename Sprinceana 24 Sep, 2009 02:43:55
gui Sprinceana 24 Sep, 2009 02:43:55
guide Sprinceana 24 Sep, 2009 02:43:55
rssFeed for this Thread

Contact us at files@mathworks.com