hi jason
you have several options - see y. altman undocumented site for further details
here are my preferred way to solve this by decreasing preference order
- create in the main function a handle struct where you attach all requires axes handles like
handles = struct;
handles.ax1 = AxesHdl1;
handles.ax2= AxesHdl2;
% you then pass this handle structure as an argument of your YlimZero callback like
mitem1.MenuSelectedFcn = {@app.YlimZero, handles};
% then beware of the definition of your callback : it should be something like
function YlimZero(hObject, event, handles)
% hObject = handle to uimenu object
% event = event message if you want to use it (or not)
% then your handles struct
% do something .... like
ylim(handles.ax1,[0,inf])
end
2 instead of passing handle struct in argument of callback, you store it and attach it to you uimenu object in the main func
like :
setappdata(mitem1, 'handles', handles);
mitem1.MenuSelectedFcn = @app.YlimZero;
%then in you callback function
function YlimZero(app, hObject, event)
handles = getappdata(hObject, 'handles');
ylim(handles.ax1,[0,inf])
end
3. less nice : you attach handle struct to mitems UserData like :
mitem1.UserData.handles = handles;
% and so on
now go to your code, old chap
best regards
Stephane