Edit -> Undo in figure does not fire ActionPostCallback for zoom - bug or feature?

Hi,
Using the 'Undo Zoom' command in a figure (via Edit -> Menu or CTRL+Z) does not call the function set by ActionPostCallback. Is this a bug or a feature? Consider the following code:
hFig = figure;
plot(rand(10));
zoom(hFig, 'on');
hZoom = zoom(hFig);
set(hZoom, 'ActionPostCallback', @(x, y)disp(datestr(now)));
The callback is fired when zooming using the mouse (as can be seen in the Command Window). However, when pressing CTRL+Z, the limits of the axes are changed, but the callback isn't fired. Any quick ideas for a workaround?
Thanks!

Answers (1)

I ended up using listeners instead of ActionPostCallback (se Darik's reply at http://www.mathworks.com/matlabcentral/newsreader/view_thread/171535). This solves my problem, but I still don't know whether it's a bug or a feature.

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Asked:

on 25 Jul 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!