My GUI in Matlab R2010b does not work in R2015a

2 views (last 30 days)
I have a GUI written in R2010b version of Matlab. Now when I tried to run that GUI within matlab, or to edit the fig file, I found that several items were not there anymore, including some all list boxes and some text boxes. The same GUI and fig file can be used on another computer still running R2010b. Does any one know a good solution how to make that GUI running under R2015a?

Accepted Answer

Walter Roberson
Walter Roberson on 21 Jan 2016
The boxes are very likely there but hidden away.
Up to R2014a, uicontrol() always showed up on top, no matter how many things were drawn above them. As of R2014b, the layer is paid attention to, so if you put something above a uicontrol, the uicontrol will be hidden behind it.
Unfortunately, GUIDE is known to have constructed some GUI in which it parented the uicontrol to the wrong layer. For example when a uipanel was created and things were added that were visually on top of that, GUIDE sometimes parented them against the original figure instead of against the uipanel. Then when the uipanel is rendered in R2014b or later, it is visually on top and hides the controls.
You need to go back in to GUIDE and fix the Parent of all of those objects. Or you can write a little bit of code that finds the objects and changes their Parent at run-time. For example if handles.editbox2, handles.checkbox7, handles.pushbutton1, and handles.textbox1 2 and 3 are all intended to be part of handles.uipanel3, then
set([handles.editbox2, handles.checkbox7, handles.pushbutton1, handles.textbox1, handles.textbox2, handles.textbox3], 'Parent', handles.uipanel3)
You would want to do that just after the call to gui_mainfcn() in the first routine in your .m file.
  1 Comment
Jun
Jun on 21 Jan 2016
Thanks so much! It is exactly the issue. I solved this by changing the boxes in guide, following your suggestions.

Sign in to comment.

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!