My GUI in Matlab R2010b does not work in R2015a
2 ビュー (過去 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?
0 件のコメント
採用された回答
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.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!