From: exosceleton on
Is it possible to change for instance the figure's WindowKeyPressFcn from another GUI callback.

when i: get(handles.figure1,'WindowKeyPressFcn')
the result is a "function_handle"

If i: set(handles.figure1,'WindowKeyPressFcn','GPRPlot(''WindowKeyPressAlternative'',hObject,eventdata,guidata(hObject))')

when the Fcn is activated i get error: Undefined function or variable 'hObject'

if i set a cell: set(handles.figure1,'WindowKeyPressFcn',{'GPRPlot(''WindowKeyPressAlternative'',hObject,eventdata,guidata(hObject))'})

i get: ??? Invalid function name
'GPRPlot('WindowKeyPressAlternative',hObject,eventdata,guidata(h'.


How do i set the callback from a script?
From: exosceleton on
OK

{@WindowKeyPressAlternative,guidata(hObject)}

works