GUI

조회 수: 2 (최근 30일)
Shree Nath
Shree Nath 2012년 6월 5일
I had created a simple GUI counting the number of cllicks and displaying it in an Edit Box. I noticed two problems :-
1. the gui doesn't work if we directly run the .fig file.. we have to run its .m file first. Any comments?
2. on closing some of my gui's, it generates these type of errors -
*??? Error using ==> feval Undefined function or method 'figure1_DeleteFcn' for input arguments of type 'struct'.
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> loadimg [dats my file name] at 43 gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)loadimg('figure1_DeleteFcn',hObject,eventdata,guidata(hObject))
??? Error using ==> delete Error while evaluating figure DeleteFcn*
dont understand what this delete function is matlab talking about.. i just used a push button callback for counting and displaying the number of clicks.. no other function..

채택된 답변

Walter Roberson
Walter Roberson 2012년 6월 6일
1. Correct. You must run the .m file. .fig files are not designed to be executable.
2. You renamed your .m file and .fig file outside of GUIDE. When you do that, GUIDE gets messed up. If you want a different name, you have to do it within GUIDE. Now you will need to check all the code in the .m file to look for references to figure1 and you will need to use the property inspector to go through all the object properties in your .fig file looking for references to figure1 . You will probably find it easier to delete your existing .m and .fig file and to rebuild it in GUIDE.
  댓글 수: 1
Shree Nath
Shree Nath 2012년 6월 6일
nopes.. i dont think i renamed anything..
btw any idea wats this DeleteFcn error?
also, is it necessary to have the CreateFcn function for every object?

댓글을 달려면 로그인하십시오.

추가 답변 (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