#######################################################################
# 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.                      #
#######################################################################

# $Id: gull_about.pm,v 1.18 1999/09/14 14:56:57 dn1 Exp $
# $Log: gull_about.pm,v $
# Revision 1.18  1999/09/14 14:56:57  dn1
# *** empty log message ***
#
# Revision 1.17  1999/06/09 13:40:47  dn1
# *** empty log message ***
#
# Revision 1.16  1999/06/09 13:38:49  dn1
# playing
#
# Revision 1.15  1999/05/28 12:22:01  dn1
# *** empty log message ***
#
# Revision 1.14  1999/05/13 12:45:05  dn1
# *** empty log message ***
#
# Revision 1.13  1999/05/11 15:40:27  dn1
# *** empty log message ***
#
# Revision 1.12  1999/05/06 16:46:55  dn1
# *** empty log message ***
#
# Revision 1.11  1999/03/23 18:39:11  dn1
# *** empty log message ***
#
# Revision 1.10  1999/03/22 18:17:41  dn1
# *** empty log message ***
#

# DN1
#######################################
# Cheesy splash screen ;)
#######################################

use strict;

package fun;

sub about {
    my ($type, $mainWindow, $BITMAP_DIR) = @_;
    my $mw = $mainWindow->Toplevel;
    $mw->configure (-title => "About.");
    my $frame_a = $mw->Frame();
    my $canvas = $mw->Canvas("-width" => 300,"-height" => 300);
    $canvas->pack("-expand" => 1, "-fill" => "both" );
    $canvas->configure (-bg => 'white');
    my $owl = $canvas->Photo(-file => "$BITMAP_DIR/gull.gif");
    $canvas->createImage(180, 200, -image => $owl);
    
    #############################
    # add some birds for fun :-)
    #############################
    my $sun = $canvas->createOval(20, 20, 80, 80, -fill => 'yellow', -outline => 'yellow');
    my $bird1p = $canvas->Photo(-file => "$BITMAP_DIR/gull1.gif");
    my $bird2p = $canvas->Photo(-file => "$BITMAP_DIR/gull2.gif");
    my $bird1 = $canvas->createImage(20, 100, -image => $bird2p);
    my $bird2 = $canvas->createImage(270, 200, -image => $bird2p);

    ######
    my $bird3 = $canvas->createImage(250, 50, -image => $bird1p);
    ######

    # tag them both as 'groups'
    $canvas->addtag('group2', withtag => $bird1);
    $canvas->addtag('group1', withtag => $bird3);
    $canvas->addtag('group2', withtag => $bird2);
    # move them
    $canvas->repeat(1000, sub {
	$canvas->move ('group1', 0, 100);
	$canvas->move ('group2', 100, 0);
	$canvas->after(250, sub {
	$canvas->move ('group1', 100, 0);
	$canvas->move ('group2', 0, 100);
    });
    $canvas->after(500, sub {
	$canvas->move ('group1', 0, -100);
	$canvas->move ('group2', -100, 0);
    });
    $canvas->after(750, sub {
	$canvas->move ('group1', -100, 0);
	$canvas->move ('group2', 0, -100);
    });

});


    my $frame_b = $mw->Frame(-relief => 'groove', -borderwidth => '3');
    my $label = $frame_b->Label(
			     -text => "Gull comprises the tools available for viewing\nand editing project related information in\nthe Oracle database.\n\nCurrent version - Production p2.16\nAuthor - dn1\@sanger.ac.uk");
    $label->pack(-side => 'top');
    $frame_b->pack;
    my $frame_c = $mw->Frame();
    my $exitButton = $frame_c->Button(- text => 'close',
				      -command => sub {$mw->destroy});
    $exitButton->pack(-side => 'top', -expand => 'yes', -fill => 'x');
    $frame_c->pack;
}

1;
