



package Information;

sub new {
my $pkg  = shift;
my $setup = {};

$setup->{SQL}			= '';
$setup->{GridRowValue}		= 3;
$setup->{GridColumnValue}	= 1;
$setup->{Infotext}		= '';
bless $setup,$pkg;
return $setup;
}#end new

sub Create {

my $pkg = shift;


if($pkg->{Subwin})
{
	if(Tk::Exists($pkg->{Subwin})){$pkg->{Subwin}->destroy(); undef $pkg->{Subwin};}
}


$pkg->{Subwin} = $pkg->{Mainwin}->Toplevel;
$pkg->{Subwin}->protocol('WM_DELETE_WINDOW', sub{$pkg->{Subwin}->destroy(); undef $pkg->{Subwin};});


$pkg->{Infotext} =$pkg->{Subwin}->Scrolled(			'Text', 
					-scrollbars		=> 'e',
					-width 			=> 100,
					-font			=> '-schumacher-clean-bold-r-normal--14-140-75-75-c-80-iso8859-1',
					-height			=> 15,	
		)->pack();
		
					
$pkg->{Infotext}->tagConfigure('RED', -foreground => 'red');
$pkg->{Infotext}->tagConfigure('BLUE', -foreground => 'blue');
}


sub Setdata {
my $pkg = shift;
if(@_)
{
	$pkg->{Rawdata} = shift;
}
else
{
	return $pkg->{Rawdata};
}
}

sub Clear {
my $pkg = shift;

if(Tk::Exists($pkg->{Subwin})){$pkg->{Subwin}->destroy(); undef $pkg->{Subwin};}
	
}


sub Showdata {
my $pkg  = shift;


if(defined $pkg->{Rawdata}->[0])
{
	$pkg->{Infotext}->insert('end',$pkg->{Rawdata}->[0],'RED');
	$pkg->{Infotext}->insert('end',$pkg->{Rawdata}->[1],'BLUE');
}
else
{
	$pkg->{Clone}= 'No Information Found';
}

}

sub Mainwindow {
my $pkg = shift;
my $w = shift;
if($w)
{
	$pkg->{Mainwin} = $$w;
}
else
{
	return $pkg->{Mainwin};
}
}
1;
