problem clicking uitable checkbox
Show older comments
Hi,
My goal is to have a button go from off to on, or viceversa, when a checkbox is selected in the table. However for some reason sometimes works sometimes doesnt. From what I can tell for some reason when I click on a checkbox the callback function runs twice so although the check box might be checked or unchecked the button might be on or off. Any ideas?
function inputTable_Callback(hObject, eventdata, handles)
data_table = get(handles.Data_Table,'Data');
if ~isempty(find([data_table{:,3}]==1))
set(findjobj(findobj(0,'Tag','RunScenario_Button')),'Enabled',true);
set(handles.RunScenario_Button,'BackgroundColor','Green')
else
set(findjobj(findobj(0,'Tag','RunScenario_Button')),'Enabled',false);
set(handles.RunScenario_Button,'BackgroundColor',[0.941176 0.941176 0.941176])
end
Answers (1)
Vincent I
on 15 Jul 2013
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!