Hi all,
I made some primitive GUI program with push button ant static text. When the button has pressed, in a window of static text will appear word OK. When I run its .m file or via a button "Run figure" it work, but when run it by double click on the .fig file, I get error becouse the handles is empty.
What I can do to solve the issue?
Below I give the code of TestText.m file and attach the TestText.fig file.
function varargout = TestText(varargin)gui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @TestText_OpeningFcn, ... 'gui_OutputFcn', @TestText_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []);if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1});endif nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});else gui_mainfcn(gui_State, varargin{:});endfunction TestText_OpeningFcn(hObject, eventdata, handles, varargin)guidata(hObject, handles);function varargout = TestText_OutputFcn(hObject, eventdata, handles) varargout{1} = handles;function pushbutton1_Callback(hObject, eventdata, handles)set(handles.text2,'String','OK')
Best Answer