Cannot get zoom post-callback to work on UIAxes
Show older comments
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 Comments
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
on 14 Oct 2020
meghannmarie
on 14 Oct 2020
Adam Danz
on 14 Oct 2020
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
on 14 Oct 2020
meghannmarie
on 14 Oct 2020
Adam Danz
on 14 Oct 2020
The release notes do not mention ActionPostCallback. hmmm, I wonder what the problem was.
meghannmarie
on 14 Oct 2020
meghannmarie
on 14 Oct 2020
Answers (0)
Categories
Find more on Data Exploration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!