in reply to Tk "hello, world", part 2
my $name; my $main = MainWindow->new(); $main->Label(-text=>"Company Name:")->pack(); my $entry = $main->Entry()->pack; $entry->focus(); $main->Button(-text=>"Continue", -command=> sub {$name = $entry->get() +; $main->destroy();})->pack(); $main->Button(-text=>"Cancel", -command => sub {exit})->pack(); $main->bind('<Return>' => sub {$main->destroy}); MainLoop; die "$name";
Also, next time, if you're going to include the error perl gave you, include all of the lines leading up to it. You can't have an error at line 38 of a 10 line script. . . :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Tk "hello, world", part 2
by RandomWalk (Beadle) on Jan 29, 2004 at 21:31 UTC |