I use GUIDE to create GUI layouts, then share data between
functions using getappdata/setappdata using the figure handle
If I accidentally hit CTRL-S while the GUI is the active
window, I end up saving the contents of the plots, controls,
and appdata in the fig file that is associated with the GUI.
Every time I run the code after that, the figure flashes
with the saved data in the plots before being cleared.
Removing all that saved data is a pain in the neck.
First, a question - is using the figure handle for
getappdata/setappdata considered bad form? Even if I used
something else, I think that I would still have the problem
of the plot data saved in the plot ui objects.
Now for the suggestion: It seems to me that what you're
creating in GUIDE isn't a figure in the same sense as what
you get when you perform a "Save" operation on a figure.
Instead, it is a template for such a figure. Why not call
the files created by GUIDE '.fgt' for figure template. It
seems to better fit the purpose of GUIDE and would have the
added benefit of making it much harder for me to
accidentally save over the GUIDE-generated file.
Am I the only one who's done this?
Gary
Subject: Re: Wish List Item - Different Extension for GUIDE figure templates
<snip>
> First, a question - is using the figure handle for
> getappdata/setappdata considered bad form? Even if I used
> something else, I think that I would still have the problem
> of the plot data saved in the plot ui objects.
</snip>
Nobody has any thoughts/opinions/advice on this?
Gary
Subject: Re: Wish List Item - Different Extension for GUIDE figure templates
I had the same problem once. My case was even worse. I
have a 3d dataset with the GUI. After hitting CTRL-S, my PC
virtually stalled. I didn't know what it was doing until a
few mins later, there was a HUGE Fig file shown up in the
directory. I didn't know what that figure file was, so out
of curiosity I tried to use "file->open", and of course, you
know, it crashed my PC.
"Gary " <grubin698@gmail.com> wrote in message
<fvshd0$81q$1@fred.mathworks.com>...
> I use GUIDE to create GUI layouts, then share data between
> functions using getappdata/setappdata using the figure handle
Subject: Re: Wish List Item - Different Extension for GUIDE figure templates
"Gary " <grubin698@gmail.com> wrote in message
<g0s0ie$d7f$1@fred.mathworks.com>...
> <snip>
> > First, a question - is using the figure handle for
> > getappdata/setappdata considered bad form? Even if I
used
> > something else, I think that I would still have the
problem
> > of the plot data saved in the plot ui objects.
> </snip>
>
> Nobody has any thoughts/opinions/advice on this?
> Gary
>
Don't use GUIDE. Manually create your GUIs using handle
graphics and nested functions. Check out the following
link:
Using GUIDE is a major pain in the neck and the cause of
many GUI-related problems. Using handle graphics and
nested functions can be confusing at first, but you will be
thankful you used this method rather than GUIDE.
If you run into problems and can't figure out how to do
something, post here and there are plenty of people who can
help.
Subject: Re: Wish List Item - Different Extension for GUIDE figure templates
> Don't use GUIDE. Manually create your GUIs using handle
> graphics and nested functions. Check out the following
> link:
>
> http://blogs.mathworks.com/pick/2007/12/28/matlab-basics-
> guis-without-guide/
>
> Using GUIDE is a major pain in the neck and the cause of
> many GUI-related problems. Using handle graphics and
> nested functions can be confusing at first, but you will
be
> thankful you used this method rather than GUIDE.
>
> If you run into problems and can't figure out how to do
> something, post here and there are plenty of people who
can
> help.
I have to agree. I've messed around with GUIDE a little bit
and it seems much cleaner to write your own GUIs with
nested functions. I think there are a few whitepaper
postings and tutorials online to show you how to construct
your own GUIs in this way.
Subject: Re: Wish List Item - Different Extension for GUIDE figure templates
About the only thing I use guide for is to lay out my GUIs
quickly. If I want to build a complicated GUI with lots of
uicontrols, I will first create it in guide. Then I copy
and paste the 'position' properties into the file I will
actually use to create my GUI. This way the physical layout
is quick and I still write my own file to get the control
over the GUI and avoid the problems of having a .m and .fig
file separately.
Subject: Re: Wish List Item - Different Extension for GUIDE figure templates
"Gary " <grubin698@gmail.com> wrote in message
<g0s0ie$d7f$1@fred.mathworks.com>...
> <snip>
> > First, a question - is using the figure handle for
> > getappdata/setappdata considered bad form? Even if I
used
> > something else, I think that I would still have the
problem
> > of the plot data saved in the plot ui objects.
> </snip>
>
> Nobody has any thoughts/opinions/advice on this?
> Gary
>
Would it be possible to make the fig-file "read only"?
/per
Subject: Re: Wish List Item - Different Extension for GUIDE figure templates
Thanks for all the advice about building my GUIs from
scratch. That was the way I started out, but really liked
the WYSIWYG aspect of GUIDE - no need to guess the proper
position values to get things in the right place.
I like Matt's approach below:
"Matt Fig" <spamanon@yahoo.com> wrote in message
<g0sg3p$jkv$1@fred.mathworks.com>...
> About the only thing I use guide for is to lay out my GUIs
> quickly. If I want to build a complicated GUI with lots of
> uicontrols, I will first create it in guide. Then I copy
> and paste the 'position' properties into the file I will
> actually use to create my GUI. This way the physical layout
> is quick and I still write my own file to get the control
> over the GUI and avoid the problems of having a .m and .fig
> file separately.
>
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.