Problem with "dirty" GUI configuration

Folks,
I have developed a large GUI project using GUIDE. It is too large to convert to the new App Developer method of developing GUI's. Nonetheless, I'm asking for some tips on how to fix a dirty configuration issue. I modified the GUI *.fig while in debug mode. Specifically, I renamed tags on 2 editable text fields and scroll bars. I believe this somehow caused a corruption to occur. Now even if I delete the offending objects from the GUI *.fig, the file still will not save and I cannot seem to recover. Is there anyway that I may fix this? The error I get is shown below.
Thank you,
Kristoffer Walker

10 Comments

These are the kinds of errors that happen when a GUIDE-GUI figure is edited while the m-file is paused in debug mode. First backup your m- and fig-files. Then make sure all breaks are cleared from the m-file (from the editor, go the breakpoints > clear all). Close the m-file and the figure file. Try running the GUI again. You may have to make all of the changes again from within GUIDE. The lesson is to never use GUIDE while the m-file is in debug mode or has breaks (better yet, close the m-file while editing the figure).
Thanks Adam. Fortunately there was a backed up version I was able to get. I'll be more careful with debug mode.
Kris
@Adam, that post seems better suited to the answer section.
Another solution is to avoid the use of GUIDE for any project complex enough to warrant the use of breakpoints. See this discussion.
Adam Danz
Adam Danz on 3 Dec 2019
Edited: Adam Danz on 3 Dec 2019
@Kristoffer, good! I've made that mistake many times while editing GUIDE-GUIs. That's one of the many reasons I stopped using GUIDE a while back.
@Rik, done, thanks for the suggestion.
@Rik, the problem is that once someone invests a bit of time in learning a system, and they are tasked with learning and remembering many other systems as part of their job, they really resist learning new systems simply to replace minor quirks with a previous system. I haven't tried App Designer yet. Perhaps it has all the same practical features of the canvas style approach of GUIDE that I love and I just need to get over the hump. The other problem is if I invest in learning App Designer, then can I convert GUIDE projects over automatically? Or do I need to remember two systems in order to sustain my many past GUIDE projects?
Kris
Matlab will eventually phase out the use of GUIDE so I wouldn't recommend starting new projects with the GUIDE GUIs. App designer is nice but the best approach IMO is to just build the GUI from the bottom-up using uicontrol() which, I realize, can be intimidating to beginners, but it catches on quickly.
"Or do I need to remember two systems in order to sustain my many past GUIDE projects?"
Neither: write your own GUI code and set yourself free !
@Adam, thanks, I'm aware. I realize this can sliip out of relevance and into a debate of philosophies, so this will be my last contribution on this from the perspective of a user with 18 years of experience supporting Matlab. Matlab created GUIDE for a good reason. It is a power app that enables very rapid development of GUIs. Once someone decides to invest the time to learn GUIDE and connect the different GUIDE-developed GUI's together, the tools that are rapidly created are robust. But I recognize that the users are the ones that drive innovation by Matlab developers, especially in the Python koolaid environment. And when too many users complain, experiements like App Designer happen. Sounds like there has been a huge positive feedback from expert users that App Designer is much better than GUIDE. Thanks again for all your help! #Matab4Ever
Adam Danz
Adam Danz on 3 Dec 2019
Edited: Adam Danz on 3 Dec 2019
Ha! I like the hashtag!
I wish there were an optional field when writing a question such as "Years of experience" so we know a little bit about the background of the person asking the question. But there are already a number of optional fields when writing the question that are commonly ignored. Matlab release number is one of them which is my biggest pet peeve when that info is missing and we later find out our solution doesn't work because the user doesn't have access to a new or updated function.
It's all good--more fields could be helpful, but sometimes simple is good too. Oh well, back to drinking my Matlab koolaid. :)

Sign in to comment.

 Accepted Answer

Adam Danz
Adam Danz on 3 Dec 2019
These are the kinds of errors that happen when a GUI figure is edited from within GUIDE while the m-file is paused in debug mode or contains break points. First backup your m- and fig-files. Then make sure all breaks are cleared from the m-file (from the editor, go the breakpoints > clear all, or use dbclear). Close the m-file and the figure file. Try running the GUI again. You may have to make all of the changes again from within GUIDE.
The lesson is to never use GUIDE while the m-file is in debug mode or has breaks (better yet, close the m-file while editing the figure).

More Answers (0)

Categories

Tags

Community Treasure Hunt

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

Start Hunting!