in reply to tk example

Why do you define %nl 3 times?

Replies are listed 'Best First'.
Re: Re: tk example
by Hofmator (Curate) on Aug 30, 2001 at 19:17 UTC

    I can only tell why -w didn't catch it ;-)

    #!/usr/bin/perl-w should have been #!/usr/bin/perl -w

    Update: Regarding the documentation issue, you should try perldoc Tk which points you to loads of documentation.

    -- Hofmator

      Thanks! Try this instead

      #!/usr/bin/perl -w use strict; use Tk; my $mw = MainWindow -> new; $mw -> title("my tk example"); my %nl = (); # newline $mw ->Label(%nl)->pack; my %nl2 = (); # newline $mw ->Label(%nl2)->pack; my %nl3 = (); # newline $mw ->Label(%nl3)->pack; my %text = ('-text',"Reminder, Don't forget to use strict!"); $mw ->Label(%text)->pack; # -ipadx = width # -ipady = height my $dialog_box = $mw -> Label()-> pack(-side => 'top', -ipadx => '120' +, -ipady => '25'); $mw -> Button(-text => "Close ", -command => sub { &exit })-> pack (-s +ide => 'bottom'); MainLoop;