Cannot get zoom post-callback to work on UIAxes
Mostrar comentarios más antiguos
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 comentarios
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
el 14 de Oct. de 2020
meghannmarie
el 14 de Oct. de 2020
Adam Danz
el 14 de Oct. de 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
el 14 de Oct. de 2020
meghannmarie
el 14 de Oct. de 2020
Adam Danz
el 14 de Oct. de 2020
The release notes do not mention ActionPostCallback. hmmm, I wonder what the problem was.
meghannmarie
el 14 de Oct. de 2020
meghannmarie
el 14 de Oct. de 2020
Respuestas (0)
Categorías
Más información sobre Data Exploration en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!