Hi,
I'm trying to study about Perl/Tk and I'm just installed Tk modules from www.cpan.org
This is my first Perl/Tk script....
#!/usr/bin/perl -w
use Tk;
my $version = "1.0";
my $main = MainWindow->new();
$main->minsize( qw(250 250));
$main->title("Billing Mediation Platform");
$main->configure(-background=>'cadet blue');
my $menu_bar = $main->Frame(-relief=>'groove',
-borderwidth => 3,
-background => 'dim grey',
)->pack('-side'=>'top', -fill=>'x');
my $file_mb = $menu_bar->Menubutton(-text=>'File',
-background => 'dim grey',
-activebackground => 'light grey',
-foreground => 'white',
)->pack(-side => 'left');
$file_mb->command(label => 'Exit', # the problem was here
-activebackground => 'magenta',
-command => sub{ $main -> destroy} );
$file_mb->separator();
MainLoop();
And I have one error message here, which is :
No -label at /usr/lib/perl5/site_perl/5.6.1/i386-linux/Tk/Widget.pm line 247
Any body can guide me on that or might be I've download wrong modeule on that?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.