Cannot get zoom post-callback to work on UIAxes
이전 댓글 표시
I cannot get the zoom post-callback to work on UIAxes in app designer. The pre-callback works fine. Here is what I have which is embedded in the app startup function:
h = zoom(app.UIAxes);
h.ActionPreCallback = @myprecallback;
h.ActionPostCallback = @mypostcallback;
h.Enable = 'on';
function myprecallback(obj,evd)
disp('A zoom is about to occur.');
end
function mypostcallback(obj,evd)
disp('A zoom has occurred.');
end
I followed the example in the help and it works of course, but it is not on a UIAxes.
댓글 수: 9
Works fine for me (r2020b).
What do you mean by, "cannot get [it] to work"? Is nothing appearing at all? Is there an error?
app.fig = uifigure();
app.UIAxes = uiaxes(app.fig);
h = zoom(app.UIAxes);
h.ActionPreCallback = @myprecallback;
h.ActionPostCallback = @mypostcallback;
h.Enable = 'on';
function myprecallback(obj,evd)
disp('A zoom is about to occur.');
end
function mypostcallback(obj,evd)
disp('A zoom has occurred.');
end
meghannmarie
2020년 10월 14일
meghannmarie
2020년 10월 14일
Adam Danz
2020년 10월 14일
That's useful information. Can you typically zoom in/out using the mouse and/or the toolbar options when you do not include these callbacks?
I don't have r2020a available right now but I might be able to check it later.
Do you have access to Matlab online? It's running r2020b and it also works well with the snippet of code in my comment.
meghannmarie
2020년 10월 14일
meghannmarie
2020년 10월 14일
Adam Danz
2020년 10월 14일
The release notes do not mention ActionPostCallback. hmmm, I wonder what the problem was.
meghannmarie
2020년 10월 14일
meghannmarie
2020년 10월 14일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Exploration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!