Writing callback functions for programmatical GUI with a handles argument
Afficher commentaires plus anciens
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?
Réponses (0)
Catégories
En savoir plus sur Interactive Control and Callbacks dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!