in reply to Perl/Tk run program
If you wanted to use the Text widget, than your only problem was that you were trying to run the command on the ref to the $text widget instead of the variable in the runprog sub, so.. what you really wanted to do is this:use Tk; use warnings; use diagnostics; use strict; my $text; my $mw = MainWindow->new; $mw->title("PerlRun"); $mw->Entry(-width => 30, -textvariable, \$text)->pack(-anchor => 'nw', -side => 'top'); $mw->Button(-text => " Run ", -command => \&runprog ) ->pack(-side => 'left', -anchor => 'sw'); $mw->Button(-text => "Done", -command => sub { exit }) ->pack(-side => 'left', -anchor => 'sw'); sub runprog { system($text); } MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perl/Tk run program
by st_possenti (Monk) on Jul 29, 2003 at 03:39 UTC | |
by JamesNC (Chaplain) on Jul 29, 2003 at 04:16 UTC | |
by st_possenti (Monk) on Jul 30, 2003 at 00:31 UTC |