For Programmers: Free Programming Magazines  


Home > Archive > Matlab > April 2005 > Renaming GUI's filename (fig and m file)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Renaming GUI's filename (fig and m file)
bobrics

2005-04-07, 4:04 pm

Hi,
I would like to rename a file I was using for GUI to some other name.

------------------------------------------
I've changed all the references I've found to the old name and replaced
them by the new one. However, during figure load, I am still getting
error that contains the old name.

Places where I've changed the names:
-gui_test2.m to new_name.m
-gui_test2.fig to new_name.fig
-Inside function gui_test2.m, the first line of code changed from
"varargout = gui_test2(varargin)" to "varargout = new_name(varargin)"


Here are the errors I am getting:

??? Error using ==> struct2handle
Undefined command/function 'gui_test2'.

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


Step by step debugging revealed that problem occurs inside hgload.m
file (\toolbox\matlab\graphics\hgload.m)
------------------------------------------

QUESTION:
WHERE else should I change the GUI name to remove this problem?


Thank you

Sam

2005-04-07, 4:04 pm

It may not be the "right" way to do it. I assume you use Guide, right?
How about just open it and "save as" into a different name and then
delete the original? It works for me...

Sam

bobrics

2005-04-08, 4:03 pm

Thanks :)

That was easy.

AJ \no z\ johnson

2005-04-08, 9:00 pm

"bobrics" <bobrics@gmail.com> wrote in message
news:1112966804.118364.26040@o13g2000cwo.googlegroups.com...
> Thanks :)
>
> That was easy.
>


Glad that works.
Also checkout the 'fig2m' (or is it 'reverse_eval'?) package on the
FileExchange. Once the figure is in ASCII form, you can (carefully!)
search/replace, then convert it back.
-Aj


bobrics

2005-04-11, 4:04 pm

why would you need to convert fig to m file? aren't they two separate
files both required for GUI to run?

thanks

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com