My GUI in Matlab R2010b does not work in R2015a

1 次查看(过去 30 天)
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?

采纳的回答

Walter Roberson
Walter Roberson 2016-1-21
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 个评论
Jun
Jun 2016-1-21
Thanks so much! It is exactly the issue. I solved this by changing the boxes in guide, following your suggestions.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by