#!/usr/bin/perl
use strict;
use Tk;
use Tk::LabFrame;
my $mw = MainWindow->new;
$mw->geometry("300x100+100+120");
$mw->minsize(300,100);
$mw->maxsize(300,100);
my $code_font = $mw->fontCreate('code', -family => 'Arial',
-size => 8,
-weight => 'normal');
my $code_font2 = $mw->fontCreate('code2', -family => 'Arial',
-size => 9,
-weight => 'bold');
# Default value
my $version = "S11";
&create_framed_optionfield($mw);
MainLoop;
sub create_framed_optionfield {
# The widget to set this frame in
my $mother = shift;
my $frame = $mother->LabFrame(
-label => "BSC Version",
-labelside => 'acrosstop',
-width => 110,
-height => 50,
)->place(-x=>10,-y=>10);
my $frame2 = $mother->LabFrame(
-label => "BSC Version",
-labelside => 'acrosstop',
-width => 110,
-height => 50,
)->place(-x=>10,-y=>120);
# Put these values into the frame
$frame->Radiobutton(
-variable => \$version,
-value => 'S11',
-text => 'S11',
)->place( -x => 10, -y => 0 );
$frame->Radiobutton(
-variable => \$version,
-value => 'S105',
-text => 'S105',
)->place( -x => 10, -y => 20 );
my $cb_1 = $mw->Button(-text => "Checking",
-font => 'code',
-foreground => 'blue',
-activebackground => 'green',
-width => 8,
-command => sub{&ToDo;}
)->place(-x=> 150, -y=>60);
my $cb_2 = $mw->Button(-text => "Cancel",
-state => 'normal',
-foreground => 'blue',
-activebackground => 'green',
-font => 'code',
-width => 8,
-command => sub {&killwin}
)->place(-x=> 220, -y=>60);
}
sub killwin{
$mw->DESTROY if Tk::Exists($mw);
exit;
}
sub ToDo{
print "Version: $version\n";
}