link to page content
Dependencies
---
  function oldcursor=swapcursor(fig,newcursor)
 
  $Id: swapcursor.m,v 1.5 2002-12-21 17:38:39-06 brinkman Exp $
  (c) 2002, Peter Brinkmann (brinkman@math.uiuc.edu)
 
  swapcursor: auxiliary function for Matlab GUIs
 
  This function sets the mouse pointer of fig to newcursor and returns
  the previous pointer type.
  
  Example:
  function varargout = some_Callback(h,eventdata,handles,varargin)
      ...
      tmp=swapcursor(handles.figure,'watch');
      try
          ...some lengthy computation...
      catch
          ...
      end
      swapcursor(handles.figure,tmp);
 
  The idea is to replace the mouse pointer by a little watch or hour glass
  while a lengthy computation is in progress. I recommend enclosing the
  computation in a try-catch-end clause to make sure that the cursor will
  always be restored to its original form.



Iode main page Page generated with Genpage - Version: 1.0.7.