--- Venkatesh Karnam <[EMAIL PROTECTED]> wrote:
> 
> I'm trying to run the following code and open a new window. But the
> program finishes without opening a window. Is there something wrong in
> the code?

You needed to add "MainLoop;" at the bottom:

#!/usr/local/bin/perl5 -w
use Tk;
use strict;

my $main = MainWindow->new();

my $menubar =
    $main->Frame(
        -relief      => "raised",
        -borderwidth => 2
    )->pack(
        -anchor => "nw",
        -fill   => "x"
    );

my $file_menu =
    $menubar->Menubutton(
        -text      => "File",
        -underline => 1
    )->pack(
        -side => "left"
    );

$file_menu->command(
    -label   => "Print",
    -command => \&Print
);

MainLoop;

See "perldoc Tk::Overview".

Cheers,
Curtis "Ovid" Poe

=====
"Ovid" on http://www.perlmonks.org/
Someone asked me how to count to 10 in Perl:
push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A

__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

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

Reply via email to