필터 지우기
필터 지우기

My GUI in Matlab R2010b does not work in R2015a

조회 수: 2 (최근 30일)
Jun
Jun 2016년 1월 20일
댓글: Jun 2016년 1월 21일
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