GUI: OpeningFcn problem
이전 댓글 표시
Hey there! I'm encountering a little problem with my GUI.
Goal: 3 panels disabled by default (when I open the GUI figure) and one of them enables when I select one of three radio buttons.
Problem: This works perfectly well when I run my GUI.m code but it shows an error when I try it by opening the GUI.fig.
OpeningFcn:
function GUI_OpeningFcn(hObject, eventdata, handles, varargin)
set(findall(handles.panel1,'-property','enable'),'enable','off');
set(findall(handles.panel2,'-property','enable'),'enable','off');
set(findall(handles.panel3,'-property','enable'),'enable','off');
handles.output = hObject;
guidata(hObject, handles);
SelectionChangeFcn:
function RadioPanel_SelectionChangeFcn(hObject, eventdata, handles)
switch hObject
case handles.radiobutton1
set(findall(handles.panel1, '-property', 'enable'), 'enable', 'off');
set(findall(handles.panel2, '-property', 'enable'), 'enable', 'off');
set(findall(handles.panel3, '-property', 'enable'), 'enable', 'on');
case handles.radiobutton2
set(findall(handles.panel1, '-property', 'enable'), 'enable', 'on');
set(findall(handles.panel2, '-property', 'enable'), 'enable', 'off');
set(findall(handles.panel3, '-property', 'enable'), 'enable', 'off');
case handles.radiobutton3
set(findall(handles.panel1, '-property', 'enable'), 'enable', 'off');
set(findall(handles.panel2, '-property', 'enable'), 'enable', 'on');
set(findall(handles.panel3, '-property', 'enable'), 'enable', 'off');
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Update figure-Based Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!