Below is a simple script which I am using as part of my attempt to learn
how to program a gui with perl and Tk. I have copied the program from a
book, "Cross Platform Perl" (not very good, but some isolated good
parts), but get the following error message when I try to compile the
program. Has anyone any idea what is wrong?
Thanks in advance,
Dick Fell



[rfell@rosewall webproject]$ tktext.pl
Unquoted string "end" may clash with future reserved word at ./tktext.pl
line 57.
Can't modify negation (-) in scalar assignment at ./tktext.pl line 8,
near ""File","
Execution of ./tktext.pl aborted due to compilation errors.
[rfell@rosewall webproject]$ 



#!/usr/local/ActivePerl-5.6/bin/perl5.6.1 -w

use Tk;
my $main=new MainWindow;
$menubar= $main->Frame(-relief=>"raised",
                       -borderwidth=>2);

$filebutton=$menubar->Menubutton;(-text="File",
                                 -underline=>0);

$filemenu=$filebutton->Menu();

$filebutton->configure(-menu=>$filemenu);

$filemenu->command(-command=>\&open_choice,
                   -label=>"Open...",
                   -underline=>0);

$filemenu->command(-command=>\&dump_choice,
                   -label=>"Dump.",
                   -underline=>0);
$filemenu->command(-command=>\&exit_choice,
                   -label=>"Exit",
                   -underline=>1);

$filemenu->pack(-side=>"left");

$text=$main->Scrolled('Text',
                      -relief=>"sunken",
                      -boderwidth=>2,
                      -setgrid=>"true");

$text->insert("1.0","This is somes text.");

$text->pack(-side=>"top",
            -expand=>1,
            -fill=>'both');

$status=$main->Label(-text=>"Status Area",
                     -relief=>"sunken",
                     -borderwidth=>2,
                     -anchor=>"w");

$status->pack(-side=>"top",-fill=>"x");

MainLoop;

sub exit_choice{
exit; }

sub open_choice{
$status->congiure(-text=>"Open file.");
}

sub dump_choice{
$status->congiure(-text=>"Dumping text...");
print $text-get("1.0",end);
}

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to