function alternate_az(window_handle) %This function handles switching between rotation and no rotation. %On a button press in the Figure, this checks to see if there is a %String set up to deal with mouse motion, if yes, it removes it. %If no, it adds it. % I think there may in the futuer be a problem with blindly shoving % in a GCF for a handle, since there is no garuntee that I can see that % says that the front window is the one that matlab thinks is the current % one. If that changes, there is a simple change that can be made to this % function, and the setup one. Instead of passing the calling this with the % alternate_az(gcf) string, call it with ['alternate_az(',gcf,');']. % Similarly, one would have to change the alt_az call in this function. %Eric Soroos %10-21-95 motion = get(window_handle,'WindowButtonMotionFcn'); if max(size(motion)) <= 2 set(gcf,'WindowButtonMotionFcn','alt_az(gcf)'); else set(gcf,'WindowButtonMotionFcn',''); end;