From: Alan B on
I have a generic, custom datatip callback function that I use frequently - it just displays object handles, more precise data values, etc, nothing really complicated. It has always been kind of fragile - it errors sometimes and debugging that callback function tends to be more painful than normal, so I have just ignored it for the most part. I just now figured out one of the main causes of the errors: the datatip callback is executed not just when a datapoint is clicked, but also upon any zoom, pan or resize action (several times for each of them).

While I can imagine situations where this might be useful, I would prefer if this callback were only executed when a datapoint is clicked when the datatip mode is active. Is there any reasonable way to do this?

I would settle with being able to detect whether zoom/pan/resize is active from within the callback, but I'm not sure how to do that. I tried to compare the state of the figure windows when zooming/not zooming by doing the following from within the datatip callback function:

xx=get(gcf);
save figstatus xx

When I then try to load figstatus.mat, Matlab opens up new figure windows until I press ctrl-C, then crashes. So I gave up on that investigation - but maybe someone else is interested to know about this easily reproducible crash?

this is a recently upgraded R2009b, on 64 bit RHEL5.3