GUI

1 次查看(过去 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 中查找有关 App Building 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by