On 2 Jun 2006 01:53:40 -0700, "king" <> wrote:
Script snipped. This should do what you want.
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
my $mw = new MainWindow; # Main Window
my $frm_name = $mw -> Frame() -> pack();
my $lab = $frm_name -> Label(-text=>"Name:") -> pack();
my $ent = $frm_name -> Entry() -> pack();
my $but = $mw -> Button(-text=>"Push Me",
-command =>\&push_button) ->pack();
#Text Area
my $txt = $mw -> Text(-width=>50, -height=>30) -> pack();
$ent->focus;
MainLoop;
#This function will be executed when the button is pushed
sub push_button {
my $name = $ent -> get();
$txt -> insert('end',"Hello, $name.\n");
$ent->delete(0,'end');
}
__END__
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html