K
king
I have a script as below to be ran in windows.
But whenever I am running this i am getting an error #No -label at C:/
Perl/lib/Tk/Widget.pm line 256#.
Sometimes I am not getting this error also but I am not getting the
output window also. Even if its not showing any error but it also is
not showing the output window.
What can be the problem?
##########################################
#!\c\perl\bin
use strict;
use warnings;
use tk;
my $main=MainWindow->new();
$main->minsize(qw(250 250));
$main->title(" calculator ");
$main->configure (-background=>'cyan');
my $menu_bar=$main->Frame(-relief=>'groove', -borderwidth=>3, -
background=>'purple',)->pack('-side'=>'top', -fill=>'x');
my $file_mb=$menu_bar->Menubutton(-text=>'File', -
background=>'purple', -activebackground=>'cyan', -
foreground=>'white',)->pack(-side=>'left');
$file_mb->command(label=>'Exit', -activebackground =>'magenta',-
command=> sub{$main->destroy});
$file_mb->separator();
my $help_mb=$menu_bar->Menubutton(-text=>'Help', -
background=>'purple', -activebackground=>'cyan', -
foreground=>'white',)->pack(-side=>'right');
$help_mb->command(-Label=>'About', -activebackground=>'magenta',-
command=> \&about_txt);
$help_mb->command(-Label=>'Help', -activebackground=>'magenta',-
command=> \&help_txt);
$help_mb->separator();
my $top=$main->Frame(-background=>'cyan',)->pack(-side=>'top',-
fill=>'X');
my $left1=$top->Frame(-background=>'cyan',)->pack(-
side=>'left',pady=>9,padx=>8);
my $t1=$left1->Label(-text=>'',-background=>'cyan')->pack();
my $t2=$left1->Label(-text=>'BUS',-background=>'cyan')->pack();
my $t3=$left1->Label(-text=>'DEVICE',-background=>'cyan')->pack();
my $t4=$left1->Label(-text=>'FUNCTION',-background=>'cyan')->pack();
my $left2=$top->Frame(-background=>'cyan',)->pack(-side=>'left',-
pady=>2,-padx=>15);
my $pre = $left2->Label (-text=>'Pretax',-background=>'cyan')->pack();
my $pre1=$left2->Label(-background=>'green', -width=>12, -
borderwidth=>2, -relief=>'sunken')->pack();
my $pre2=$left2->Label(-background=>'green', -width=>12, -
borderwidth=>2, -relief=>'sunken')->pack();
my $pre3=$left2->Label(-background=>'green', -width=>12, -
borderwidth=>2, -relief=>'sunken')->pack();
my $left3=$top->Frame(-background=>'cyan',)->pack(-side=>'left',-
pady=>2,-padx=>15);
my $post = $left3->Label (-text=>'posttax',-background=>'cyan')-
borderwidth=>2, -relief=>'sunken')->pack();
my $post2=$left3->Label(-background=>'green', -width=>12, -
borderwidth=>2, -relief=>'sunken')->pack();
my $post3=$left3->Label(-background=>'green', -width=>12, -
borderwidth=>2, -relief=>'sunken')->pack();
my $left4=$top->Frame(-background=>'cyan',)->pack(-side=>'left',-
pady=>2,-padx=>15);
my $tax = $left4->Label (-text=>'taxation',-background=>'cyan')-
borderwidth=>2, -relief=>'sunken')->pack();
my $tax2=$left4->Label(-background=>'green', -width=>12, -
borderwidth=>2, -relief=>'sunken')->pack();
my $tax3=$left4->Label(-background=>'green', -width=>12, -
borderwidth=>2, -relief=>'sunken')->pack();
MainLoop();
#No -label at C:/Perl/lib/Tk/Widget.pm line 256
####################################################
But whenever I am running this i am getting an error #No -label at C:/
Perl/lib/Tk/Widget.pm line 256#.
Sometimes I am not getting this error also but I am not getting the
output window also. Even if its not showing any error but it also is
not showing the output window.
What can be the problem?
##########################################
#!\c\perl\bin
use strict;
use warnings;
use tk;
my $main=MainWindow->new();
$main->minsize(qw(250 250));
$main->title(" calculator ");
$main->configure (-background=>'cyan');
my $menu_bar=$main->Frame(-relief=>'groove', -borderwidth=>3, -
background=>'purple',)->pack('-side'=>'top', -fill=>'x');
my $file_mb=$menu_bar->Menubutton(-text=>'File', -
background=>'purple', -activebackground=>'cyan', -
foreground=>'white',)->pack(-side=>'left');
$file_mb->command(label=>'Exit', -activebackground =>'magenta',-
command=> sub{$main->destroy});
$file_mb->separator();
my $help_mb=$menu_bar->Menubutton(-text=>'Help', -
background=>'purple', -activebackground=>'cyan', -
foreground=>'white',)->pack(-side=>'right');
$help_mb->command(-Label=>'About', -activebackground=>'magenta',-
command=> \&about_txt);
$help_mb->command(-Label=>'Help', -activebackground=>'magenta',-
command=> \&help_txt);
$help_mb->separator();
my $top=$main->Frame(-background=>'cyan',)->pack(-side=>'top',-
fill=>'X');
my $left1=$top->Frame(-background=>'cyan',)->pack(-
side=>'left',pady=>9,padx=>8);
my $t1=$left1->Label(-text=>'',-background=>'cyan')->pack();
my $t2=$left1->Label(-text=>'BUS',-background=>'cyan')->pack();
my $t3=$left1->Label(-text=>'DEVICE',-background=>'cyan')->pack();
my $t4=$left1->Label(-text=>'FUNCTION',-background=>'cyan')->pack();
my $left2=$top->Frame(-background=>'cyan',)->pack(-side=>'left',-
pady=>2,-padx=>15);
my $pre = $left2->Label (-text=>'Pretax',-background=>'cyan')->pack();
my $pre1=$left2->Label(-background=>'green', -width=>12, -
borderwidth=>2, -relief=>'sunken')->pack();
my $pre2=$left2->Label(-background=>'green', -width=>12, -
borderwidth=>2, -relief=>'sunken')->pack();
my $pre3=$left2->Label(-background=>'green', -width=>12, -
borderwidth=>2, -relief=>'sunken')->pack();
my $left3=$top->Frame(-background=>'cyan',)->pack(-side=>'left',-
pady=>2,-padx=>15);
my $post = $left3->Label (-text=>'posttax',-background=>'cyan')-
my $post1=$left3->Label(-background=>'green', -width=>12, -pack();
borderwidth=>2, -relief=>'sunken')->pack();
my $post2=$left3->Label(-background=>'green', -width=>12, -
borderwidth=>2, -relief=>'sunken')->pack();
my $post3=$left3->Label(-background=>'green', -width=>12, -
borderwidth=>2, -relief=>'sunken')->pack();
my $left4=$top->Frame(-background=>'cyan',)->pack(-side=>'left',-
pady=>2,-padx=>15);
my $tax = $left4->Label (-text=>'taxation',-background=>'cyan')-
my $tax1=$left4->Label(-background=>'green', -width=>12, -pack();
borderwidth=>2, -relief=>'sunken')->pack();
my $tax2=$left4->Label(-background=>'green', -width=>12, -
borderwidth=>2, -relief=>'sunken')->pack();
my $tax3=$left4->Label(-background=>'green', -width=>12, -
borderwidth=>2, -relief=>'sunken')->pack();
MainLoop();
#No -label at C:/Perl/lib/Tk/Widget.pm line 256
####################################################