Hello,
I have a GUI with several edit boxes which sow the names of files which have been selected by the user. I aso have some radio buttons which dictate what operation to complete on the data which is loaded vvia the GUI.
When I have loaded the data and then click a radio button which was not the default, all the edit boxes clear and it seems as though the GUI is reinitialised. I have not used the radio button group call back for selectionChanged. All I do is check which radio button has been clicked when it comes to performing the calculations. Does anyone know why the radio button keeps reinitialising the GUI?
The code for initialising the GUI objects I have written is:
function defaultVals(hObject, handles)%
% This function takes the handle to the GUI figure, and structure with
% handles and user data and sets the values of the various
% objects on the GUI.
% Call this function in the Openingfunction of the GUI to set initial
% values for the GUI objects.
set(handles.textPath,'string','No file loaded.'); % sets default value of textFile
set(handles.textFile,'string','No file loaded.'); % sets default value of textData
set(handles.checkbox1 , 'Enable','off'); % disable checkbox1;
I placed this function in the OpeningFcn. After using the dbstack (Thanks to Jan Simon's suggestion) I found the following call stack was produced when I placed 'dbstack' in my defaultVals function:
In VoltageResonance>defaultVals (line 272) In VoltageResonance>VoltageResonance_OpeningFcn (line 58) In gui_mainfcn (line 220) In VoltageResonance (line 42) In matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)VoltageResonance('trainConfigGroup_SelectionChangedFcn',get(hObject,'SelectedObject'),eventdata,guidata(get(hObject,'SelectedObject')))
It appears that the function matlab.graphics.internal.figfile.FigFile/read causes the GUI to be run again but I am not sure where that function arises from by changing a radio button. Kind regards, TJ
Best Answer