Cannot get zoom post-callback to work on UIAxes
Afficher commentaires plus anciens
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 commentaires
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
le 14 Oct 2020
meghannmarie
le 14 Oct 2020
Adam Danz
le 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
le 14 Oct 2020
meghannmarie
le 14 Oct 2020
Adam Danz
le 14 Oct 2020
The release notes do not mention ActionPostCallback. hmmm, I wonder what the problem was.
meghannmarie
le 14 Oct 2020
meghannmarie
le 14 Oct 2020
Réponses (0)
Catégories
En savoir plus sur Data Exploration 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!