#######################################################################
# This software has been created by Genome Research Limited (GRL).    # 
# GRL hereby grants permission to use, copy, modify and distribute    # 
# this software and its documentation for non-commercial purposes     # 
# without fee at the user's own risk on the basis set out below.      #
# GRL neither undertakes nor accepts any duty whether contractual or  # 
# otherwise in connection with the software, its use or the use of    # 
# any derivative, and makes no representations or warranties, express #
# or implied, concerning the software, its suitability, fitness for   #
# a particular purpose or non-infringement.                           #
# In no event shall the authors of the software or GRL be responsible # 
# or liable for any loss or damage whatsoever arising in any way      # 
# directly or indirectly out of the use of this software or its       # 
# derivatives, even if advised of the possibility of such damage.     #
# Our software can be freely distributed under the conditions set out # 
# above, and must contain this copyright notice.                      #
#######################################################################

package AniCursor;


my $lwin;
my $lcanv;
my $fid =-1;
my $cursor;
my $count =1;
###################################################################################################
sub StopCursor{

 if($fid != -1)
 {
     $lwin->afterCancel($fid);
     $fid =-1;
     $count =1;
     $lcanv->configure(-cursor => 'arrow');
 }
}
###################################################################################################
sub StartCursor{

    my ($win,$canv) = @_;

    #window canvas array of widget ids ...

    $lwin = $win;     # global wind
    $lcanv = $canv;   # global canv
  #  $cursor = ($lcanv->configure(-cursor));
    &StopCursor;    # stop any ongoing flashing
    $fid = $lwin->repeat(300,\&SetCursor)  if($fid == -1);
        
}
###################################################################################################
sub SetCursor{

    $lcanv->configure(-cursor => ['@'.'/nfs/disk37/cgb/pathogen/src/ptk/h1','white']) if($count == 1);
    $lcanv->configure(-cursor => ['@'.'/nfs/disk37/cgb/pathogen/src/ptk/h2','white']) if($count == 2);
    $lcanv->configure(-cursor => ['@'.'/nfs/disk37/cgb/pathogen/src/ptk/h3','white']) if($count == 3);
    $lcanv->configure(-cursor => ['@'.'/nfs/disk37/cgb/pathogen/src/ptk/h2','white']) if($count == 4);
    $count++;
    $count = 1 if($count > 4);
}
################################################################################################
1;
