GUIDE callback question
Ältere Kommentare anzeigen
I have a button group (tag: DBI_ButtonGroup) with two radio buttons (tag1: radio_DBI tag2: radio_non_DBI)
My selctionchangefcn callback is as follows:
% --- Executes when selected object is changed in DBI_ButtonGroup.
function DBI_ButtonGroup_SelectionChangeFcn(hObject, eventdata, handles)
% hObject handle to the selected object in DBI_ButtonGroup
% eventdata structure with the following fields (see UIBUTTONGROUP)
% EventName: string 'SelectionChanged' (read only)
% OldValue: handle of the previously selected object or empty if none was selected
% NewValue: handle of the currently selected object
% handles structure with handles and user data (see GUIDATA)
switch get(eventdata.NewValue,'Tag') % Get Tag of selected object.
case 'radio_DBI'
set(handles.no_ADC,'Enable','Off')
otherwise
set(handles.no_ADC,'Enable','On')
end
So I basically want to change the tag called no_ADC (which is an edit text control, to Enable = off or Enable = on based on the radio button selection. When I run this, however, MATLAB spits out the following error:
Error using handle.handle/get
Invalid or deleted object.
Error in uitools.uibuttongroup/childAddedCbk>manageButtons (line 59)
oldctrl = get(hgroup, 'OldSelectedObject');
Error while evaluating uicontrol Callback
I don't understand what is wrong.
4 Kommentare
Leor Greenberger
am 28 Sep. 2011
Leor Greenberger
am 28 Sep. 2011
Daniel Shub
am 28 Sep. 2011
Is the manageButtons function a standard MATLAB function?
Leor Greenberger
am 28 Sep. 2011
Akzeptierte Antwort
Weitere Antworten (1)
Alberto
am 26 Okt. 2016
0 Stimmen
I think I found the solution. Just left-click on buttongrup panel and Bring to front, also the same with all radiobuttons inside the buttongrup panel. That worked for me.
Kategorien
Mehr zu Interactive Control and Callbacks finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!