|
I have the following code (below) attached to a checkbox and it works. However, My question is as follows:
Is there a better way to reset the vaules of the popupmenu to the default values on startup?
------Code----------------------
function checkbox2_Callback(hObject, eventdata, handles)
status=get(hObject,'Value');
if status==1
set(handles.popupmenu3,'enable','on');
set(handles.popupmenu3,'String', handles.titles_string);
set(handles.checkbox3,'enable','on');
else
set(handles.checkbox2,'value',0);
set(handles.popupmenu3,'enable','off');
set(handles.popupmenu3,'Value',1);
set(handles.popupmenu3,'String', 'Not Active');
set(handles.checkbox3,'enable','off');
set(handles.checkbox3,'value',0);
set(handles.popupmenu4,'enable','off');
set(handles.popupmenu4,'Value',1);
set(handles.popupmenu4,'String', 'Not Active');
temp=get(handles.radiobutton4,'value');
if temp==1
set(handles.radiobutton2,'value',1)
handles.RadioButtonState=0;
end
end
guidata(hObject, handles);
|