Writing callback functions for programmatical GUI with a handles argument
이전 댓글 표시
Callback function handles in GUIDE take on the form:
@(hObject,eventdata)mygui('some_Callback',hObject,eventdata,guidata(hObject))
I have written function handles of this form for my programmatically created GUI, but when running them, I get the following error:
??? Error using ==> report_manager
Too many input arguments.
Error in ==>
report_manager>makeCallback/@(hObject,eventdata)mygui('some_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
The make callback function it's referencing looks like:
function callback = makeCallback ( callback_name )
callback = {evalin('base',['@(hObject,eventdata)mygui','(''',callback_name,''',hObject,eventdata,guidata(hObject))'])};
I have no problem in creating callbacks when they take the simple form: callback = {@fnhandle_Callback}
The problem with this is that to get the handles array, I have to have a line of code in each callback handles=guidata(hObject). What do I need to change to include the 3rd argument in my callbacks?
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!