0
我的GUI在單個搜索按鈕下有兩個複選框,即colourcheck
和Texturecheck
。如果我點擊搜索按鈕,它應該檢查上面提到的兩種類型,並且應該運行相應的程序,並且如果兩個盒子都處於「MIN」位置,即沒有被檢查,則它應該給用戶一個消息,說明select type of search
。MATLAB GUI中的複選框
我修剪了search_callback程序。
function Search_Callback(hObject, eventdata, handles)
% hObject handle to Search (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data
% --- Executes on button press in colourcheck.
function colourcheck_Callback(hObject, eventdata, handles)
% hObject handle to colourcheck (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data
% Hint: get(hObject,'Value') returns toggle state of colourcheck
if (get(hObject,'Value') == get(hObject,'Max'))
Search_Callback(hObject, eventdata, handles)
else
% Checkbox is not checked-take approriate action
end
但是我無法滿足要求。請幫助我,任何解決方案都是可觀的。
非常感謝。但是在colourcheck和Texturecheck_callback函數中寫什麼呢? – Chethan 2013-03-16 11:11:29
您不需要在colourcheck和texturecheck回調中寫入任何內容。你用get(handles.Texturecheck,'Value')讀取它們的值並獲取(handles.colourCheck,'Value')。如果你喜歡答案,考慮接受它! :) – Molly 2013-03-16 14:45:59
恩,謝謝:) – Chethan 2013-03-16 15:08:48